Skip to content

Commit

Permalink
Allow top level object not to be a plain object
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk committed Apr 13, 2017
1 parent 6923bc6 commit cbd000a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var isPlainObject = require('is-plain-object');
var objectAssign = require('object-assign');

module.exports = function(obj, fn, opts) {
if (!isPlainObject(obj)) {
if (!isObject(obj)) {
return;
}

Expand Down Expand Up @@ -50,3 +50,8 @@ function forEachChild(node, baseKey, fn, depth, opts) {
forEachChild(value, keyChain, fn, depth, opts);
}
}

function isObject(v) {
return Object.prototype.toString.call(v) === '[object Object]';
}

2 changes: 1 addition & 1 deletion web/each-props.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cbd000a

Please sign in to comment.