isobject
v4.1.1
Published
Returns true if the value is an object and not an array or null.
Readme
isobject
Returns
trueif a value is an object and not an array ornull.
Please consider following this project's author, Jon Schlinkert, and starring the project to show your ❤️ and support.
Use is-plain-object if you only want objects created by the Object constructor.
Install
npm install isobjectUsage
const isObject = require('isobject');
isObject({}); // true
isObject(Object.create(null)); // true
isObject(new Date()); // true
isObject(/foo/); // true
isObject(); // false
isObject(null); // false
isObject([]); // false
isObject(() => {}); // false
isObject('foo'); // falseAPI
isObject(value)
Returns true when value is a non-null object and is not an array. Functions return false.
Development
Install dependencies, build the CommonJS bundle, and run the tests:
npm install
npm run build
npm testRelated projects
- extend-shallow: Extend an object with the properties of additional objects.
- is-plain-object: Check if an object was created by the
Objectconstructor. - kind-of: Get the native type of a value.
- merge-deep: Recursively merge values in an object.
License
MIT © Jon Schlinkert
