CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
index.d.ts36 linesDownload Raw Back to is-plain-obj
1/**2Check if a value is a plain object.3 4An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.5 6@example7```8import isPlainObject from 'is-plain-obj';9import {runInNewContext} from 'node:vm';10 11isPlainObject({foo: 'bar'});12//=> true13 14isPlainObject(new Object());15//=> true16 17isPlainObject(Object.create(null));18//=> true19 20// This works across realms21isPlainObject(runInNewContext('({})'));22//=> true23 24isPlainObject([1, 2, 3]);25//=> false26 27class Unicorn {}28isPlainObject(new Unicorn());29//=> false30 31isPlainObject(Math);32//=> false33```34*/35export default function isPlainObject<Value>(value: unknown): value is Record<PropertyKey, Value>;36