MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / isPlainObject

Method isPlainObject

packages/core/src/utils/Utils.ts:782–792  ·  view source on GitHub ↗

* Checks whether the value is POJO (e.g. `{ foo: 'bar' }`, and not instance of `Foo`)

(value: any)

Source from the content-addressed store, hash-verified

780 * Checks whether the value is POJO (e.g. `{ foo: 'bar' }`, and not instance of `Foo`)
781 */
782 static isPlainObject<T extends Dictionary>(value: any): value is T {
783 return (
784 (value !== null &&
785 typeof value === 'object' &&
786 typeof value.constructor === 'function' &&
787 (Object.hasOwn(value.constructor.prototype, 'isPrototypeOf') ||
788 Object.getPrototypeOf(value.constructor.prototype) === null)) ||
789 (value && Object.getPrototypeOf(value) === null) ||
790 value instanceof PlainObject
791 );
792 }
793
794 /**
795 * Executes the `cb` promise serially on every element of the `items` array and returns array of resolved values.

Callers 15

nativeUpdateManyMethod · 0.80
renameFieldsMethod · 0.80
buildFieldsMethod · 0.80
runQueryMethod · 0.80
createUpdatePayloadMethod · 0.80
quoteValueFunction · 0.80
streamFunction · 0.80
nativeUpdateFunction · 0.80
nativeUpdateManyFunction · 0.80
getFieldsForJoinedLoadFunction · 0.80
renderPartialIndexWhereFunction · 0.80
buildPopulateOrderByFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected