Skip to content

Commit 5da8cee

Browse files
authored
Merge pull request #3 from humandx/rev/type
Update types
2 parents 1edb4ac + 1270b01 commit 5da8cee

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

index.d.ts

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,36 @@
33
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

6-
declare namespace humps {
7-
8-
function camelize(value: string): string;
9-
function pascalize(value: string): string;
10-
function decamelize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
11-
function depascalize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
6+
declare module "@humandx/humps" {
7+
declare namespace humps {
8+
function camelize(value: string): string;
9+
function pascalize(value: string): string;
10+
function decamelize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
11+
function depascalize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
1212

13-
function camelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
14-
function pascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
15-
function decamelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
16-
function depascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
13+
function camelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
14+
function pascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
15+
function decamelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
16+
function depascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
1717

18-
function camelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
19-
function pascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
20-
function decamelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
21-
function depascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
18+
function camelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
19+
function pascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
20+
function decamelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
21+
function depascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
2222

23-
interface HumpsOptions {
24-
separator?: string;
25-
split?: RegExp;
26-
process?: HumpsProcessor;
27-
ignorePrivate?: boolean;
28-
}
29-
interface HumpsProcessor {
30-
(key: string, convert: HumpsProcessorParameter, options?: HumpsOptions): string;
31-
}
32-
interface HumpsProcessorParameter {
33-
(key: string, options?: HumpsOptions): string;
34-
}
35-
type OptionOrProcessor = HumpsOptions | HumpsProcessor;
36-
}
37-
38-
declare module "@humandx/humps" {
39-
export = humps;
23+
interface HumpsOptions {
24+
separator?: string;
25+
split?: RegExp;
26+
process?: HumpsProcessor;
27+
ignorePrivate?: boolean;
28+
}
29+
interface HumpsProcessor {
30+
(key: string, convert: HumpsProcessorParameter, options?: HumpsOptions): string;
31+
}
32+
interface HumpsProcessorParameter {
33+
(key: string, options?: HumpsOptions): string;
34+
}
35+
type OptionOrProcessor = HumpsOptions | HumpsProcessor;
36+
}
37+
export = humps;
4038
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@humandx/humps",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.",
55
"main": "humps.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)