1 | export interface Options {
|
2 | /**
|
3 | Character or string inserted to separate words in `string`.
|
4 |
|
5 | @default '_'
|
6 |
|
7 | @example
|
8 | ```
|
9 | import decamelize from 'decamelize';
|
10 |
|
11 | decamelize('unicornRainbow');
|
12 | //=> 'unicorn_rainbow'
|
13 |
|
14 | decamelize('unicornRainbow', {separator: '-'});
|
15 | //=> 'unicorn-rainbow'
|
16 | ```
|
17 | */
|
18 | readonly separator?: string;
|
19 |
|
20 | /**
|
21 | Preserve sequences of uppercase characters.
|
22 |
|
23 | @default false
|
24 |
|
25 | @example
|
26 | ```
|
27 | import decamelize from 'decamelize';
|
28 |
|
29 | decamelize('testGUILabel');
|
30 | //=> 'test_gui_label'
|
31 |
|
32 | decamelize('testGUILabel', {preserveConsecutiveUppercase: true});
|
33 | //=> 'test_GUI_label'
|
34 | ```
|
35 | */
|
36 | readonly preserveConsecutiveUppercase?: boolean;
|
37 | }
|
38 |
|
39 | /**
|
40 | Convert a camelized string into a lowercased one with a custom separator: `unicornRainbow` → `unicorn_rainbow`.
|
41 |
|
42 | @param string - The camelcase string to decamelize.
|
43 |
|
44 | @example
|
45 | ```
|
46 | import decamelize from 'decamelize';
|
47 |
|
48 | decamelize('unicornRainbow');
|
49 | //=> 'unicorn_rainbow'
|
50 |
|
51 | decamelize('unicornRainbow', {separator: '-'});
|
52 | //=> 'unicorn-rainbow'
|
53 | ```
|
54 | */
|
55 | export default function decamelize(string: string, options?: Options): string;
|