Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mits87 authored Mar 11, 2020
1 parent 6049cca commit 9a46e22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const transform = (input, callback) => {
if (!input || typeof input !== 'object') return callback(input);
if (typeof input === 'string') return callback(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

0 comments on commit 9a46e22

Please sign in to comment.