Skip to content

Commit

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

module.exports = function(src, dst, fromto, converter, reverse) {

if (!isPlainObject(src)) {
if (!isObject(src)) {
src = {};
}

if (!isPlainObject(dst)) {
if (!isObject(dst)) {
dst = {};
}

Expand Down Expand Up @@ -214,3 +214,7 @@ function setParentEmptyObject(obj, fromto) {
function newUndefined() {
return undefined;
}

function isObject(v) {
return Object.prototype.toString.call(v) === '[object Object]';
}
2 changes: 1 addition & 1 deletion web/copy-props.js

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

0 comments on commit 1d00a4a

Please sign in to comment.