Skip to content

Commit

Permalink
Improved plain object checking (#5036)
Browse files Browse the repository at this point in the history
  • Loading branch information
risa committed Oct 6, 2022
1 parent 7a06a36 commit d701c7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -132,7 +132,7 @@ const isPlainObject = (val) => {
}

const prototype = getPrototypeOf(val);
return prototype === null || prototype === Object.prototype;
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
}

/**
Expand Down

0 comments on commit d701c7b

Please sign in to comment.