5.0.0 • Published 4 years ago

is-plain-object v5.0.0

Weekly downloads
22,829,006
License
MIT
Repository
github
Last release
4 years ago

is-plain-object NPM version NPM monthly downloads NPM total downloads Linux Build Status

Returns true if an object was created by the Object constructor, or Object.create(null).

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.

Install

Install with npm:

$ npm install --save is-plain-object

Use isobject if you only want to check if the value is an object and not an array or null.

Usage

with es modules

import { isPlainObject } from 'is-plain-object';

or with commonjs

const { isPlainObject } = require('is-plain-object');

true when created by the Object constructor, or Object.create(null).

isPlainObject(Object.create({}));
//=> true
isPlainObject(Object.create(Object.prototype));
//=> true
isPlainObject({foo: 'bar'});
//=> true
isPlainObject({});
//=> true
isPlainObject(null);
//=> true

false when not created by the Object constructor.

isPlainObject(1);
//=> false
isPlainObject(['foo', 'bar']);
//=> false
isPlainObject([]);
//=> false
isPlainObject(new Foo);
//=> false
isPlainObject(Object.create(null));
//=> false

About

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

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:

$ npm install && npm test

(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:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Related projects

You might also be interested in these projects:

Contributors

CommitsContributor
19jonschlinkert
6TrySound
6stevenvachon
3onokumus
1wtgtybhertgeghgtwtg

Author

Jon Schlinkert

License

Copyright © 2019, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on April 28, 2019.

is-extendableset-valueclone-deepstylelintfinedliftoffsanitize-htmlcopy-propseach-propsreact-element-to-jsx-stringfree-minarchetype-librarycomponennentteasy-select-rnvuedragdropuploadimagestim-dva-corepopsmart-common-authreact-native-bluetooth2killi8n-react-native-fast-image@artibulles-cis/reactrn-send-smsslate-react-es6specify-importsbabel-specify-imports@icanpm/api-mastergew-nodejs-api-clientreact-portal-pop@arisageha/react-lazyload@arisageha/react-lazyload-fix@braid/vue-formulate-next@artiweb.artibulles/artiweb-reactartiweb-react@cashremit/cr-streamline-icons@gerkensm/slate-history@gerkensm/slate-hyperscript@gerkensm/slate-reactbcgj-mind-corepatched-slate-hyperscript@blink-mind-teams/corereact-native-template-rfbaseslate-react-rx@deity/falcon-uicloud-archive-s3airscanairscan-exampletjvbb-chatreact-native-esc-pos-sahaabslatechecksubslatechecksub-reactgatsby-yaml-full-objectstring@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-api@searchkings/node-loggerdeneme323112@baijiahei/slate-history@baijiahei/slate-react@baijiahei/slate@texttree/demo-bsa-reference-rcl@robmayer/slate-react@glorywong/log@fundefund/funde_ckvnu-builder@ntt_app/react-native-custom-notificationobject-path-immutable-rowrowrowrowreact-native-custom-text-hwjames@lottojs/corereact-native-covid-sdkgql_din_modbitgethexidave-material-ui-corereact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewertalkfe-clicthpb-plugin-socialkoalicyberco-model@checksub/slate-react@checksub/slate@checksub/slate-history@checksub/slate-hyperscriptmultiple-clireact-native-printer-brothersrn-pdf-reader-offlinecbmis-ai-toolboxdiox-cloner@mkiloyan/core@i-machine/gm-xreact-native-shekhar-bridge-testcogoportutilsruntime-configuratorlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27
5.0.0

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.0.1

4 years ago

3.0.0

5 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago

0.1.0

10 years ago