(entity: T, primaryKeys: EntityKey<T>[])
| 588 | } |
| 589 | |
| 590 | static getPrimaryKeyCond<T>(entity: T, primaryKeys: EntityKey<T>[]): Record<string, Primary<T>> | null { |
| 591 | const cond = primaryKeys.reduce((o, pk) => { |
| 592 | o[pk] = Utils.extractPK(entity[pk]); |
| 593 | return o; |
| 594 | }, {} as any); |
| 595 | |
| 596 | if (Object.values(cond).some(v => v === null)) { |
| 597 | return null; |
| 598 | } |
| 599 | |
| 600 | return cond; |
| 601 | } |
| 602 | |
| 603 | /** |
| 604 | * Maps nested FKs from `[1, 2, 3]` to `[1, [2, 3]]`. |
no test coverage detected