4.1.0 • Published 2 years ago

is-plain-obj v4.1.0

Weekly downloads
19,924,666
License
MIT
Repository
github
Last release
2 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

sort-keyshttp-proxy-middlewareminimist-optionsstrip-dirsunifiedyargs-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_release@314oner_npm/universal-components-libraryreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uireact-native-jawwy_sample@igniswap/igni-swap-lib@idas1/ui-component-lib@icedesign/iceworks-scaffolder@innoswap/chainlink-whitelist@innoswap/core@innoswap/default-token-list@innodata/vue-v3-ya-metrika@hieuquang2212/form@haijoon2/lotidee@hassanabdi/lotide@hawkingnetwork/react-native-tab-view@hanlindev/cancan@harinderlabana/lotide@hiroyone/number-formatter@hmcts/http-proxy-middleware@img-arena/img-ui-mui-theme@img-arena/ui-core
4.1.0

2 years ago

4.0.0

3 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.0

5 years ago

1.1.0

8 years ago

1.0.0

9 years ago