forked from codinasion-archive/codinasion-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
npm: Add @codinasion/string (codinasion-archive#4904)
- Loading branch information
1 parent
6845a8a
commit eadd657
Showing
3,303 changed files
with
57,313 additions
and
1,105 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"codinasion": patch | ||
"@codinasion/eslint-config": patch | ||
--- | ||
|
||
Add string manipulation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
--- | ||
"@codinasion/constant-case-string-to-sentence-case-string": major | ||
"@codinasion/sentence-case-string-to-constant-case-string": major | ||
"@codinasion/constant-case-string-to-header-case-string": major | ||
"@codinasion/constant-case-string-to-pascal-case-string": major | ||
"@codinasion/sentence-case-string-to-header-case-string": major | ||
"@codinasion/sentence-case-string-to-pascal-case-string": major | ||
"@codinasion/constant-case-string-to-camel-case-string": major | ||
"@codinasion/constant-case-string-to-kebab-case-string": major | ||
"@codinasion/constant-case-string-to-lower-case-string": major | ||
"@codinasion/constant-case-string-to-snake-case-string": major | ||
"@codinasion/constant-case-string-to-title-case-string": major | ||
"@codinasion/constant-case-string-to-upper-case-string": major | ||
"@codinasion/sentence-case-string-to-camel-case-string": major | ||
"@codinasion/sentence-case-string-to-kebab-case-string": major | ||
"@codinasion/sentence-case-string-to-lower-case-string": major | ||
"@codinasion/sentence-case-string-to-snake-case-string": major | ||
"@codinasion/sentence-case-string-to-title-case-string": major | ||
"@codinasion/sentence-case-string-to-upper-case-string": major | ||
"@codinasion/constant-case-string-to-path-case-string": major | ||
"@codinasion/header-case-string-to-constant-case-string": major | ||
"@codinasion/header-case-string-to-sentence-case-string": major | ||
"@codinasion/pascal-case-string-to-constant-case-string": major | ||
"@codinasion/pascal-case-string-to-sentence-case-string": major | ||
"@codinasion/sentence-case-string-to-path-case-string": major | ||
"@codinasion/constant-case-string-to-dot-case-string": major | ||
"@codinasion/sentence-case-string-to-dot-case-string": major | ||
"@codinasion/camel-case-string-to-constant-case-string": major | ||
"@codinasion/camel-case-string-to-sentence-case-string": major | ||
"@codinasion/header-case-string-to-pascal-case-string": major | ||
"@codinasion/kebab-case-string-to-constant-case-string": major | ||
"@codinasion/kebab-case-string-to-sentence-case-string": major | ||
"@codinasion/lower-case-string-to-constant-case-string": major | ||
"@codinasion/lower-case-string-to-sentence-case-string": major | ||
"@codinasion/pascal-case-string-to-header-case-string": major | ||
"@codinasion/snake-case-string-to-constant-case-string": major | ||
"@codinasion/snake-case-string-to-sentence-case-string": major | ||
"@codinasion/title-case-string-to-constant-case-string": major | ||
"@codinasion/title-case-string-to-sentence-case-string": major | ||
"@codinasion/upper-case-string-to-constant-case-string": major | ||
"@codinasion/upper-case-string-to-sentence-case-string": major | ||
"@codinasion/header-case-string-to-camel-case-string": major | ||
"@codinasion/header-case-string-to-kebab-case-string": major | ||
"@codinasion/header-case-string-to-lower-case-string": major | ||
"@codinasion/header-case-string-to-snake-case-string": major | ||
"@codinasion/header-case-string-to-title-case-string": major | ||
"@codinasion/header-case-string-to-upper-case-string": major | ||
"@codinasion/pascal-case-string-to-camel-case-string": major | ||
"@codinasion/pascal-case-string-to-kebab-case-string": major | ||
"@codinasion/pascal-case-string-to-lower-case-string": major | ||
"@codinasion/pascal-case-string-to-snake-case-string": major | ||
"@codinasion/pascal-case-string-to-title-case-string": major | ||
"@codinasion/pascal-case-string-to-upper-case-string": major | ||
"@codinasion/camel-case-string-to-header-case-string": major | ||
"@codinasion/camel-case-string-to-pascal-case-string": major | ||
"@codinasion/header-case-string-to-path-case-string": major | ||
"@codinasion/kebab-case-string-to-header-case-string": major | ||
"@codinasion/kebab-case-string-to-pascal-case-string": major | ||
"@codinasion/lower-case-string-to-header-case-string": major | ||
"@codinasion/lower-case-string-to-pascal-case-string": major | ||
"@codinasion/pascal-case-string-to-path-case-string": major | ||
"@codinasion/path-case-string-to-constant-case-string": major | ||
"@codinasion/path-case-string-to-sentence-case-string": major | ||
"@codinasion/snake-case-string-to-header-case-string": major | ||
"@codinasion/snake-case-string-to-pascal-case-string": major | ||
"@codinasion/title-case-string-to-header-case-string": major | ||
"@codinasion/title-case-string-to-pascal-case-string": major | ||
"@codinasion/upper-case-string-to-header-case-string": major | ||
"@codinasion/upper-case-string-to-pascal-case-string": major | ||
"@codinasion/camel-case-string-to-kebab-case-string": major | ||
"@codinasion/camel-case-string-to-lower-case-string": major | ||
"@codinasion/camel-case-string-to-snake-case-string": major | ||
"@codinasion/camel-case-string-to-title-case-string": major | ||
"@codinasion/camel-case-string-to-upper-case-string": major | ||
"@codinasion/header-case-string-to-dot-case-string": major | ||
"@codinasion/kebab-case-string-to-camel-case-string": major | ||
"@codinasion/kebab-case-string-to-lower-case-string": major | ||
"@codinasion/kebab-case-string-to-snake-case-string": major | ||
"@codinasion/kebab-case-string-to-title-case-string": major | ||
"@codinasion/kebab-case-string-to-upper-case-string": major | ||
"@codinasion/lower-case-string-to-camel-case-string": major | ||
"@codinasion/lower-case-string-to-kebab-case-string": major | ||
"@codinasion/lower-case-string-to-snake-case-string": major | ||
"@codinasion/lower-case-string-to-title-case-string": major | ||
"@codinasion/lower-case-string-to-upper-case-string": major | ||
"@codinasion/pascal-case-string-to-dot-case-string": major | ||
"@codinasion/snake-case-string-to-camel-case-string": major | ||
"@codinasion/snake-case-string-to-kebab-case-string": major | ||
"@codinasion/snake-case-string-to-lower-case-string": major | ||
"@codinasion/snake-case-string-to-title-case-string": major | ||
"@codinasion/snake-case-string-to-upper-case-string": major | ||
"@codinasion/title-case-string-to-camel-case-string": major | ||
"@codinasion/title-case-string-to-kebab-case-string": major | ||
"@codinasion/title-case-string-to-lower-case-string": major | ||
"@codinasion/title-case-string-to-snake-case-string": major | ||
"@codinasion/title-case-string-to-upper-case-string": major | ||
"@codinasion/upper-case-string-to-camel-case-string": major | ||
"@codinasion/upper-case-string-to-kebab-case-string": major | ||
"@codinasion/upper-case-string-to-lower-case-string": major | ||
"@codinasion/upper-case-string-to-snake-case-string": major | ||
"@codinasion/upper-case-string-to-title-case-string": major | ||
"@codinasion/camel-case-string-to-path-case-string": major | ||
"@codinasion/dot-case-string-to-constant-case-string": major | ||
"@codinasion/dot-case-string-to-sentence-case-string": major | ||
"@codinasion/kebab-case-string-to-path-case-string": major | ||
"@codinasion/lower-case-string-to-path-case-string": major | ||
"@codinasion/path-case-string-to-header-case-string": major | ||
"@codinasion/path-case-string-to-pascal-case-string": major | ||
"@codinasion/snake-case-string-to-path-case-string": major | ||
"@codinasion/title-case-string-to-path-case-string": major | ||
"@codinasion/upper-case-string-to-path-case-string": major | ||
"@codinasion/camel-case-string-to-dot-case-string": major | ||
"@codinasion/kebab-case-string-to-dot-case-string": major | ||
"@codinasion/lower-case-string-to-dot-case-string": major | ||
"@codinasion/path-case-string-to-camel-case-string": major | ||
"@codinasion/path-case-string-to-kebab-case-string": major | ||
"@codinasion/path-case-string-to-lower-case-string": major | ||
"@codinasion/path-case-string-to-snake-case-string": major | ||
"@codinasion/path-case-string-to-title-case-string": major | ||
"@codinasion/path-case-string-to-upper-case-string": major | ||
"@codinasion/snake-case-string-to-dot-case-string": major | ||
"@codinasion/title-case-string-to-dot-case-string": major | ||
"@codinasion/upper-case-string-to-dot-case-string": major | ||
"@codinasion/dot-case-string-to-header-case-string": major | ||
"@codinasion/dot-case-string-to-pascal-case-string": major | ||
"@codinasion/dot-case-string-to-camel-case-string": major | ||
"@codinasion/dot-case-string-to-kebab-case-string": major | ||
"@codinasion/dot-case-string-to-lower-case-string": major | ||
"@codinasion/dot-case-string-to-snake-case-string": major | ||
"@codinasion/dot-case-string-to-title-case-string": major | ||
"@codinasion/dot-case-string-to-upper-case-string": major | ||
"@codinasion/path-case-string-to-dot-case-string": major | ||
"@codinasion/dot-case-string-to-path-case-string": major | ||
"@codinasion/constant-case-string": major | ||
"@codinasion/sentence-case-string": major | ||
"@codinasion/header-case-string": major | ||
"@codinasion/pascal-case-string": major | ||
"@codinasion/camel-case-string": major | ||
"@codinasion/kebab-case-string": major | ||
"@codinasion/lower-case-string": major | ||
"@codinasion/snake-case-string": major | ||
"@codinasion/title-case-string": major | ||
"@codinasion/upper-case-string": major | ||
"@codinasion/path-case-string": major | ||
"@codinasion/dot-case-string": major | ||
"@codinasion/string-to-constant-case": major | ||
"@codinasion/string-to-sentence-case": major | ||
"@codinasion/string-to-header-case": major | ||
"@codinasion/string-to-pascal-case": major | ||
"@codinasion/string-to-camel-case": major | ||
"@codinasion/string-to-kebab-case": major | ||
"@codinasion/string-to-lower-case": major | ||
"@codinasion/string-to-snake-case": major | ||
"@codinasion/string-to-title-case": major | ||
"@codinasion/string-to-upper-case": major | ||
"@codinasion/string-to-path-case": major | ||
"@codinasion/string-to-dot-case": major | ||
"@codinasion/case": major | ||
"@codinasion/string": major | ||
--- | ||
|
||
Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./dsa"; | ||
export * from "./language-data"; | ||
export * from "./number-system"; | ||
export * from "./string"; |
34 changes: 34 additions & 0 deletions
34
...mel-case-string-to-constant-case-string/camel-case-string-to-constant-case-string.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { CamelCaseStringToConstantCaseString } from "./camel-case-string-to-constant-case-string"; | ||
|
||
describe("CamelCaseStringToConstantCaseString", () => { | ||
test("converts camelCase to CONSTANT_CASE", () => { | ||
expect(CamelCaseStringToConstantCaseString("helloWorld")).toBe( | ||
"HELLO_WORLD", | ||
); | ||
expect(CamelCaseStringToConstantCaseString("thisIsATest")).toBe( | ||
"THIS_IS_A_TEST", | ||
); | ||
expect(CamelCaseStringToConstantCaseString("anotherExample")).toBe( | ||
"ANOTHER_EXAMPLE", | ||
); | ||
}); | ||
|
||
test("returns empty string for empty input", () => { | ||
expect(CamelCaseStringToConstantCaseString("")).toBe(""); | ||
}); | ||
|
||
test("throws error for non-string input", () => { | ||
expect(() => | ||
CamelCaseStringToConstantCaseString(null as unknown as string), | ||
).toThrow(); | ||
expect(() => | ||
CamelCaseStringToConstantCaseString(undefined as unknown as string), | ||
).toThrow(); | ||
expect(() => | ||
CamelCaseStringToConstantCaseString(123 as unknown as string), | ||
).toThrow(); | ||
expect(() => | ||
CamelCaseStringToConstantCaseString({} as unknown as string), | ||
).toThrow(); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
...ng/camel-case-string-to-constant-case-string/camel-case-string-to-constant-case-string.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Converts a camel case string to a constant case string. | ||
* | ||
* @param str - The camel case string to convert. | ||
* @returns The converted constant case string. | ||
*/ | ||
export function CamelCaseStringToConstantCaseString(str: string): string { | ||
return str.replace(/[A-Z]/g, (match) => `_${match}`).toUpperCase(); | ||
} |
1 change: 1 addition & 0 deletions
1
...sion/src/string/case/camel-case-string/camel-case-string-to-constant-case-string/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./camel-case-string-to-constant-case-string"; |
32 changes: 32 additions & 0 deletions
32
...-string/camel-case-string-to-dot-case-string/camel-case-string-to-dot-case-string.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CamelCaseStringToDotCaseString } from "./camel-case-string-to-dot-case-string"; | ||
|
||
describe("CamelCaseStringToDotCaseString", () => { | ||
test("converts camelCase to dot.case", () => { | ||
expect(CamelCaseStringToDotCaseString("helloWorld")).toBe("hello.world"); | ||
expect(CamelCaseStringToDotCaseString("thisIsATest")).toBe( | ||
"this.is.a.test", | ||
); | ||
expect(CamelCaseStringToDotCaseString("anotherExample")).toBe( | ||
"another.example", | ||
); | ||
}); | ||
|
||
test("returns empty string for empty input", () => { | ||
expect(CamelCaseStringToDotCaseString("")).toBe(""); | ||
}); | ||
|
||
test("throws error for non-string input", () => { | ||
expect(() => | ||
CamelCaseStringToDotCaseString(null as unknown as string), | ||
).toThrow(); | ||
expect(() => | ||
CamelCaseStringToDotCaseString(undefined as unknown as string), | ||
).toThrow(); | ||
expect(() => | ||
CamelCaseStringToDotCaseString(123 as unknown as string), | ||
).toThrow(); | ||
expect(() => | ||
CamelCaseStringToDotCaseString({} as unknown as string), | ||
).toThrow(); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
...-case-string/camel-case-string-to-dot-case-string/camel-case-string-to-dot-case-string.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Converts a camel case string to dot case string. | ||
* @param str - The camel case string to convert. | ||
* @returns The dot case string. | ||
*/ | ||
export function CamelCaseStringToDotCaseString(str: string): string { | ||
return str.replace(/[A-Z]/g, (match) => `.${match.toLowerCase()}`); | ||
} |
1 change: 1 addition & 0 deletions
1
...odinasion/src/string/case/camel-case-string/camel-case-string-to-dot-case-string/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./camel-case-string-to-dot-case-string"; |
25 changes: 25 additions & 0 deletions
25
...g/camel-case-string-to-header-case-string/camel-case-string-to-header-case-string.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { CamelCaseStringToHeaderCaseString } from "./camel-case-string-to-header-case-string"; | ||
|
||
describe("CamelCaseStringToHeaderCaseString", () => { | ||
test("converts a camelCase string to header-case", () => { | ||
expect(CamelCaseStringToHeaderCaseString("camelCaseString")).toBe( | ||
"Camel-Case-String", | ||
); | ||
expect(CamelCaseStringToHeaderCaseString("anotherCamelCaseString")).toBe( | ||
"Another-Camel-Case-String", | ||
); | ||
}); | ||
|
||
test("returns an empty string if input is empty", () => { | ||
expect(CamelCaseStringToHeaderCaseString("")).toBe(""); | ||
}); | ||
|
||
test("returns the same string if input is already in header-case", () => { | ||
expect(CamelCaseStringToHeaderCaseString("header-case-string")).toBe( | ||
"Header-Case-String", | ||
); | ||
expect(CamelCaseStringToHeaderCaseString("Header-Case-String")).toBe( | ||
"Header-Case-String", | ||
); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
...string/camel-case-string-to-header-case-string/camel-case-string-to-header-case-string.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Converts a camel case string to header case string. | ||
* | ||
* @param str - The camel case string to convert. | ||
* @returns The converted header case string. | ||
*/ | ||
export function CamelCaseStringToHeaderCaseString(str: string): string { | ||
return str | ||
.replace(/(?<temp2>[a-z])(?<temp1>[A-Z])/g, "$1-$2") | ||
.replace(/\b\w/g, (match) => match.toUpperCase()); | ||
} |
1 change: 1 addition & 0 deletions
1
...nasion/src/string/case/camel-case-string/camel-case-string-to-header-case-string/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./camel-case-string-to-header-case-string"; |
22 changes: 22 additions & 0 deletions
22
...ing/camel-case-string-to-kebab-case-string/camel-case-string-to-kebab-case-string.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CamelCaseStringToKebabCaseString } from "./camel-case-string-to-kebab-case-string"; | ||
|
||
describe("CamelCaseStringToKebabCaseString", () => { | ||
test("converts a camelCase string to kebab-case", () => { | ||
expect(CamelCaseStringToKebabCaseString("camelCaseString")).toBe( | ||
"camel-case-string", | ||
); | ||
expect(CamelCaseStringToKebabCaseString("anotherCamelCaseString")).toBe( | ||
"another-camel-case-string", | ||
); | ||
}); | ||
|
||
test("returns an empty string if input is empty", () => { | ||
expect(CamelCaseStringToKebabCaseString("")).toBe(""); | ||
}); | ||
|
||
test("returns the same string if input is already in kebab-case", () => { | ||
expect(CamelCaseStringToKebabCaseString("kebab-case-string")).toBe( | ||
"kebab-case-string", | ||
); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
...e-string/camel-case-string-to-kebab-case-string/camel-case-string-to-kebab-case-string.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Converts a camel case string to kebab case string. | ||
* | ||
* @param str - The camel case string to convert. | ||
* @returns The kebab case string. | ||
*/ | ||
export function CamelCaseStringToKebabCaseString(str: string): string { | ||
return str.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`); | ||
} |
1 change: 1 addition & 0 deletions
1
...inasion/src/string/case/camel-case-string/camel-case-string-to-kebab-case-string/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./camel-case-string-to-kebab-case-string"; |
22 changes: 22 additions & 0 deletions
22
...ing/camel-case-string-to-lower-case-string/camel-case-string-to-lower-case-string.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CamelCaseStringToLowerCaseString } from "./camel-case-string-to-lower-case-string"; | ||
|
||
describe("CamelCaseStringToLowerCaseString", () => { | ||
test("converts a camelCase string to lower case", () => { | ||
expect(CamelCaseStringToLowerCaseString("camelCaseString")).toBe( | ||
"camel case string", | ||
); | ||
expect(CamelCaseStringToLowerCaseString("anotherCamelCaseString")).toBe( | ||
"another camel case string", | ||
); | ||
}); | ||
|
||
test("returns an empty string if input is empty", () => { | ||
expect(CamelCaseStringToLowerCaseString("")).toBe(""); | ||
}); | ||
|
||
test("returns the same string if input is already in lower case", () => { | ||
expect(CamelCaseStringToLowerCaseString("lower case string")).toBe( | ||
"lower case string", | ||
); | ||
}); | ||
}); |
Oops, something went wrong.