Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | declare namespace camelcase {
|
---|
2 | interface Options {
|
---|
3 | /**
|
---|
4 | Uppercase the first character: `foo-bar` → `FooBar`.
|
---|
5 |
|
---|
6 | @default false
|
---|
7 | */
|
---|
8 | readonly pascalCase?: boolean;
|
---|
9 | }
|
---|
10 | }
|
---|
11 |
|
---|
12 | declare const camelcase: {
|
---|
13 | /**
|
---|
14 | Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
|
---|
15 |
|
---|
16 | @param input - String to convert to camel case.
|
---|
17 |
|
---|
18 | @example
|
---|
19 | ```
|
---|
20 | import camelCase = require('camelcase');
|
---|
21 |
|
---|
22 | camelCase('foo-bar');
|
---|
23 | //=> 'fooBar'
|
---|
24 |
|
---|
25 | camelCase('foo_bar');
|
---|
26 | //=> 'fooBar'
|
---|
27 |
|
---|
28 | camelCase('Foo-Bar');
|
---|
29 | //=> 'fooBar'
|
---|
30 |
|
---|
31 | camelCase('Foo-Bar', {pascalCase: true});
|
---|
32 | //=> 'FooBar'
|
---|
33 |
|
---|
34 | camelCase('--foo.bar', {pascalCase: false});
|
---|
35 | //=> 'fooBar'
|
---|
36 |
|
---|
37 | camelCase('foo bar');
|
---|
38 | //=> 'fooBar'
|
---|
39 |
|
---|
40 | console.log(process.argv[3]);
|
---|
41 | //=> '--foo-bar'
|
---|
42 | camelCase(process.argv[3]);
|
---|
43 | //=> 'fooBar'
|
---|
44 |
|
---|
45 | camelCase(['foo', 'bar']);
|
---|
46 | //=> 'fooBar'
|
---|
47 |
|
---|
48 | camelCase(['__foo__', '--bar'], {pascalCase: true});
|
---|
49 | //=> 'FooBar'
|
---|
50 | ```
|
---|
51 | */
|
---|
52 | (input: string | ReadonlyArray<string>, options?: camelcase.Options): string;
|
---|
53 |
|
---|
54 | // TODO: Remove this for the next major release, refactor the whole definition to:
|
---|
55 | // declare function camelcase(
|
---|
56 | // input: string | ReadonlyArray<string>,
|
---|
57 | // options?: camelcase.Options
|
---|
58 | // ): string;
|
---|
59 | // export = camelcase;
|
---|
60 | default: typeof camelcase;
|
---|
61 | };
|
---|
62 |
|
---|
63 | export = camelcase;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.