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

Method hasObjectKeys

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

* Returns true if `obj` has at least one property. This is 20x faster than Object.keys(obj).length. * @see https://github.com/deepkit/deepkit-framework/blob/master/packages/core/src/core.ts

(object: Dictionary)

Source from the content-addressed store, hash-verified

247 * @see https://github.com/deepkit/deepkit-framework/blob/master/packages/core/src/core.ts
248 */
249 static hasObjectKeys(object: Dictionary): boolean {
250 for (const key in object) {
251 if (Object.hasOwn(object, key)) {
252 return true;
253 }
254 }
255
256 return false;
257 }
258
259 /**
260 * Checks if arguments are deeply (but not strictly) equal.

Callers 15

createUpdatePayloadMethod · 0.80
nativeUpdateFunction · 0.80
alterTableMethod · 0.80
applyJoinedFiltersMethod · 0.80
whereMethod · 0.80
isNotEmptyObjectMethod · 0.80
initMethod · 0.80
processDataMethod · 0.80
diffToSQLMethod · 0.80
getJoinedFiltersMethod · 0.80
applyFiltersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected