From b4c7b94a02da80dc1cde1b4c9b9aa2a34f6a734a Mon Sep 17 00:00:00 2001 From: Victor Shia Date: Mon, 11 Oct 2021 09:28:35 -0700 Subject: [PATCH 1/2] Update types --- index.d.ts | 60 ++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/index.d.ts b/index.d.ts index 4ed32c3..855458c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3,38 +3,36 @@ // Definitions by: Niklas Mollenhauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace humps { - - function camelize(value: string): string; - function pascalize(value: string): string; - function decamelize(value: string, optionsOrProcessor?: OptionOrProcessor): string; - function depascalize(value: string, optionsOrProcessor?: OptionOrProcessor): string; +declare module "@humandx/humps" { + declare namespace humps { + function camelize(value: string): string; + function pascalize(value: string): string; + function decamelize(value: string, optionsOrProcessor?: OptionOrProcessor): string; + function depascalize(value: string, optionsOrProcessor?: OptionOrProcessor): string; - function camelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; - function pascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; - function decamelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; - function depascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; + function camelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; + function pascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; + function decamelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; + function depascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object; - function camelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; - function pascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; - function decamelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; - function depascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; + function camelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; + function pascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; + function decamelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; + function depascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[]; - interface HumpsOptions { - separator?: string; - split?: RegExp; - process?: HumpsProcessor; - ignorePrivate?: boolean; - } - interface HumpsProcessor { - (key: string, convert: HumpsProcessorParameter, options?: HumpsOptions): string; - } - interface HumpsProcessorParameter { - (key: string, options?: HumpsOptions): string; - } - type OptionOrProcessor = HumpsOptions | HumpsProcessor; -} - -declare module "@humandx/humps" { - export = humps; + interface HumpsOptions { + separator?: string; + split?: RegExp; + process?: HumpsProcessor; + ignorePrivate?: boolean; + } + interface HumpsProcessor { + (key: string, convert: HumpsProcessorParameter, options?: HumpsOptions): string; + } + interface HumpsProcessorParameter { + (key: string, options?: HumpsOptions): string; + } + type OptionOrProcessor = HumpsOptions | HumpsProcessor; + } + export = humps; } From 1270b01e9b4e0ee6fdc1b197ae59f38ba9d6000f Mon Sep 17 00:00:00 2001 From: Victor Shia Date: Mon, 11 Oct 2021 09:30:32 -0700 Subject: [PATCH 2/2] Update patch version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4438a0d..912c9a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@humandx/humps", - "version": "2.0.5", + "version": "2.0.6", "description": "Underscore-to-camelCase converter (and vice versa) for strings and object keys in JavaScript.", "main": "humps.js", "types": "index.d.ts",