Skip to content

Commit

Permalink
Merge pull request #942 from matthewtff/cache-object-string-value
Browse files Browse the repository at this point in the history
Cached Object string representation
  • Loading branch information
gaearon committed Oct 23, 2015
2 parents 9b00b02 + 28c80b8 commit 82b75d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/isPlainObject.js
@@ -1,4 +1,5 @@
var fnToString = (fn) => Function.prototype.toString.call(fn);
var objStringValue = fnToString(Object);

/**
* @param {any} obj The object to inspect.
Expand All @@ -19,5 +20,5 @@ export default function isPlainObject(obj) {

return typeof constructor === 'function'
&& constructor instanceof constructor
&& fnToString(constructor) === fnToString(Object);
&& fnToString(constructor) === objStringValue;
}

0 comments on commit 82b75d6

Please sign in to comment.