AK-21/Graphite-Industrial-Intelligence
0
1# is-plain-obj2 3> Check if a value is a plain object4 5An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.6 7## Install8 9```10$ npm install is-plain-obj11```12 13## Usage14 15```js16import isPlainObject from 'is-plain-obj';17import {runInNewContext} from 'node:vm';18 19isPlainObject({foo: 'bar'});20//=> true21 22isPlainObject(new Object());23//=> true24 25isPlainObject(Object.create(null));26//=> true27 28// This works across realms29isPlainObject(runInNewContext('({})'));30//=> true31 32isPlainObject([1, 2, 3]);33//=> false34 35class Unicorn {}36isPlainObject(new Unicorn());37//=> false38 39isPlainObject(Math);40//=> false41```42 43## Related44 45- [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object46- [is](https://github.com/sindresorhus/is) - Type check values47 48---49 50<div align="center">51 <b>52 <a href="https://tidelift.com/subscription/pkg/npm-is-plain-obj?utm_source=npm-is-plain-obj&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>53 </b>54 <br>55 <sub>56 Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.57 </sub>58</div>59 