4.1.0 • Published 3 years ago

is-plain-obj v4.1.0

Weekly downloads
19,924,666
License
MIT
Repository
github
Last release
3 years ago

is-plain-obj

Check if a value is a plain object

An object is plain if it's created by either {}, new Object(), or Object.create(null).

Install

$ npm install is-plain-obj

Usage

import isPlainObject from 'is-plain-obj';
import {runInNewContext} from 'node:vm';

isPlainObject({foo: 'bar'});
//=> true

isPlainObject(new Object());
//=> true

isPlainObject(Object.create(null));
//=> true

// This works across realms
isPlainObject(runInNewContext('({})'));
//=> true

isPlainObject([1, 2, 3]);
//=> false

class Unicorn {}
isPlainObject(new Unicorn());
//=> false

isPlainObject(Math);
//=> false

Related

  • is-obj - Check if a value is an object
  • is - Type check values

execasort-keysstrip-dirsminimist-optionsunifiedyargs-unparserwrite-json-fileextract-filesarchetype-librarycomponennentteasy-select-rnchinjowwchinjowvuedragdropuploadimages@care-for/yargs-unparserreact-native-bluetooth2killi8n-react-native-fast-imagevietmap-sdk@cashremit/cr-streamline-iconscloud-archive-s3airscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@texttree/demo-bsa-reference-rcl@ntt_app/react-native-custom-notification@sonammalhotra/lotide@smishra17/lotide@cheapthrills/lotidereact-native-covid-sdkcf-marky-markdown@jttechnic/interpretertokei-js@unifiedts/engine@unifiedts/unified@iobroker-community-adapters/iobroker.device-watchermysql-formatreact-native-printer-brothers@newhorizon-tech/dd-npm-package-templatereact-native-shekhar-bridge-testcogoportutilsdyx-reactlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29levinodelib@nicholasjj/lotidetalent-to-vite-cli@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testreact-native-slider-kfunblock-block-save-variables@infinitebrahmanuniverse/nolb-is-pcclibyarntest@saaspe/componentshyperpass-sdkexpand-react-bridgeopea-bootstraapluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-1934iqra-calculatorjawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uireact-native-jawwy_samplelapture-ui-complaptureuigriffin-ui-library@wacoco/ytaman-baca-masyarakattapshottar-to-filetailwind-vector-effecttest-carosello-campustest-iki-mini-apptest-library-123test-eachtest-haptik-libwinx-form-winxwinston-error-formatweb-audio-streamweb-elements-iconsweb-component-tester-bundle
4.1.0

3 years ago

4.0.0

4 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.0

6 years ago

1.1.0

10 years ago

1.0.0

10 years ago