Skip to content

Commit 1d00a4a

Browse files
author
sttk
committed
Allow top level objects not to be plain objects
1 parent cfddead commit 1d00a4a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ var isPlainObject = require('is-plain-object');
55

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

8-
if (!isPlainObject(src)) {
8+
if (!isObject(src)) {
99
src = {};
1010
}
1111

12-
if (!isPlainObject(dst)) {
12+
if (!isObject(dst)) {
1313
dst = {};
1414
}
1515

@@ -214,3 +214,7 @@ function setParentEmptyObject(obj, fromto) {
214214
function newUndefined() {
215215
return undefined;
216216
}
217+
218+
function isObject(v) {
219+
return Object.prototype.toString.call(v) === '[object Object]';
220+
}

web/copy-props.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)