-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
26 lines (26 loc) · 895 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export default kebabCase;
/**
* Transforms a string into kebab-case.
*
* @example
* kebabCase("helloWorld"); // "hello-world"
* kebabCase("HelloWorld"); // "-hello-world"
* kebabCase("HelloWorld", false); // "hello-world"
*
* @param {string} str The string to transform
* @param {boolean} keepLeadingDash Whether to keep the leading dash in case the string starts with an uppercase letter (default: true)
* @returns The kebab-cased string
*/
declare function kebabCase(str: string, keepLeadingDash?: boolean): string | undefined;
declare namespace kebabCase {
/**
* Transforms a kebab-cased string back to the original string.
*
* @example
* kebabCase.reverse("hello-world"); // "helloWorld"
*
* @param {string} str
* @returns The original string, with the kebab-case transformation reversed
*/
function reverse(str: string): string;
}