Skip to content

Commit 783de52

Browse files
committed
address issue 5151 - relax condition check when running with node.js
1 parent 94b31a8 commit 783de52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/is_plain_object.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
'use strict';
1111

12+
var isNodeJS = window.name === 'nodejs';
13+
1214
// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing
1315
module.exports = function isPlainObject(obj) {
1416
// We need to be a little less strict in the `imagetest` container because
@@ -21,6 +23,6 @@ module.exports = function isPlainObject(obj) {
2123

2224
return (
2325
Object.prototype.toString.call(obj) === '[object Object]' &&
24-
Object.getPrototypeOf(obj) === Object.prototype
26+
(isNodeJS || Object.getPrototypeOf(obj) === Object.prototype)
2527
);
2628
};

0 commit comments

Comments
 (0)