jonschlinkert / set-value

Set nested properties on an object using dot-notation.
https://github.com/jonschlinkert
MIT License
271 stars 41 forks source link

Dependency on is-plain-object #10

Closed EJBroeders closed 6 years ago

EJBroeders commented 6 years ago

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.

jonschlinkert commented 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.