Skip to content

Commit

Permalink
when input is empty then just return
Browse files Browse the repository at this point in the history
  • Loading branch information
mits87 committed Jan 5, 2020
1 parent 2995b88 commit e5599e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const transform = (input, callback) => {
if (typeof input !== 'object') return input;
if (!input || typeof input !== 'object') return input;
if (Array.isArray(input)) return input.map(item => transform(item, callback));

return Object.keys(input).reduce((acc, key) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transform-keys-deep",
"version": "0.0.1",
"version": "0.0.2",
"description": "Deeply convert the keys of an object to camelCase",
"author": "Piotr Krajewski <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit e5599e2

Please sign in to comment.