Package Exports
- is-extendable
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-extendable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-extendable 
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?"
Install
Install with npm
$ npm i is-extendable --saveUsage
var isExtendable = require('is-extendable');Returns true if the value is any of the following:
arrayregexpplain objectfunctiondateerror
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 an
object,function
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.
Related projects
- isobject: Returns true if the value is an object and not an array or null.
- is-plain-object: Returns true if an object was created by the
Objectconstructor. - is-equal-shallow: Does a shallow comparison of two objects, returning false if the keys or values differ.
Running tests
Install dev dependencies:
$ npm i -d && npm testContributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on June 28, 2015.