Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?"
Returns true if the value is any of the following:
array
plain object
function
Notes
All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not null or undefined and:
the value is not a primitive, or
that the object is a plain object, function or array
Also note that an extendable object is not the same as an extensible object, which is one that (in es6) is not sealed, frozen, or marked as non-extensible using preventExtensions.
Release history
v1.0.0 - 2017/07/20
Breaking changes
No longer considers date, regex or error objects to be extendable
About
Related projects
assign-deep: Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… more | homepage
is-equal-shallow: Does a shallow comparison of two objects, returning false if the keys or values differ. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: