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

Method getPrimaryKeyHash

packages/core/src/utils/Utils.ts:518–532  ·  view source on GitHub ↗
(pks: (string | Buffer | Date)[])

Source from the content-addressed store, hash-verified

516 }
517
518 static getPrimaryKeyHash(pks: (string | Buffer | Date)[]): string {
519 return pks
520 .map(pk => {
521 if (Buffer.isBuffer(pk)) {
522 return pk.toString('hex');
523 }
524
525 if (pk instanceof Date) {
526 return pk.toISOString();
527 }
528
529 return pk;
530 })
531 .join(this.PK_SEPARATOR);
532 }
533
534 static splitPrimaryKeys<T extends object>(key: string): EntityKey<T>[] {
535 return key.split(this.PK_SEPARATOR) as EntityKey<T>[];

Callers 15

buildPivotResultMapFunction · 0.80
applyUnionWhereFunction · 0.80
applyJoinedFiltersMethod · 0.80
hashMethod · 0.80
wrapPaginateSubQueryMethod · 0.80
wrapModifySubQueryMethod · 0.80
processMethod · 0.80
renameFieldToPKMethod · 0.80
getPkSerializerMethod · 0.80

Calls 3

joinMethod · 0.65
mapMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected