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

Function empty

packages/decorators/src/utils.ts:80–80  ·  view source on GitHub ↗
(v: unknown)

Source from the content-addressed store, hash-verified

78
79 // validate only first parameter is used if its an option object
80 const empty = (v: unknown) => v == null || (Utils.isPlainObject(v) && !Utils.hasObjectKeys(v));
81 if (values.slice(1).some(v => !empty(v))) {
82 throw new Error(
83 'Mixing first decorator parameter as options object with other parameters is forbidden. ' +

Callers 1

Calls 2

isPlainObjectMethod · 0.80
hasObjectKeysMethod · 0.80

Tested by

no test coverage detected