Skip to content

Commit

Permalink
Update humps v2.x.x camelizeKeys function definition (#4230)
Browse files Browse the repository at this point in the history
* Update humps v2.x.x camelizeKeys function definition

Co-authored-by: David Coelho <davidcoelho02@outlook.com>

* Make the definition more strict

Co-authored-by: David Coelho <davidcoelho02@outlook.com>
Co-authored-by: Bruno Martins <bruno.martins@xing.com>
  • Loading branch information
3 people committed Jan 13, 2022
1 parent a8843d1 commit 543649a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions definitions/npm/humps_v2.x.x/flow_v0.104.x-/humps_v2.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ declare module "humps" {
options?: Options
): { [string]: mixed, ... };

declare export function camelizeKeys(
Array<{ +[string]: mixed, ... }>,
options?: Options
): Array<{ [string]: mixed, ... }>;

declare export default {|
camelize: typeof camelize,
pascalize: typeof pascalize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ describe("tests", () => {
(pascalizeKeys({ foo: 1 }): { [string]: mixed, ... });
(decamelizeKeys({ foo: 1 }): { [string]: mixed, ... });
(depascalizeKeys({ foo: 1 }): { [string]: mixed, ... });

(camelizeKeys([{ foo: 1 }]): Array<{ [string]: mixed, ... }>);
(camelizeKeys([{ foo: "bar" }]): Array<{ [string]: mixed, ... }>);
});
});

0 comments on commit 543649a

Please sign in to comment.