Closed EJBroeders closed 6 years ago
No, that's not the same thing. That would return true for null
, an instance of Date
, RegExp
, Map
, Set
or any other native or custom constructor. A plain object is specifically an object that was created by the Object
constructor.
Would it make sense to replace the dependency on is-plain-object with:
const isPlain = obj => typeof obj === 'object';
?This would reduce the total number of dependencies to zero, which is always a great aim on itself.