@mikro-orm/core
Advanced tools
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "version": "7.1.9-dev.12", | ||
| "version": "7.1.9-dev.13", | ||
| "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,3 +6,3 @@ import { EntityIdentifier } from '../entity/EntityIdentifier.js'; | ||
| import { isRaw } from '../utils/RawQueryFragment.js'; | ||
| import { Utils } from '../utils/Utils.js'; | ||
| import { equals, Utils } from '../utils/Utils.js'; | ||
| import { OptimisticLockError, ValidationError } from '../errors.js'; | ||
@@ -342,3 +342,4 @@ import { ReferenceKind } from '../enums.js'; | ||
| if (res.length !== changeSets.length) { | ||
| const compare = (a, b, keys) => keys.every(k => a[k] === b[k]); | ||
| // a FK pointing to a composite PK is an array, so the values need to be compared deeply | ||
| const compare = (a, b, keys) => keys.every(k => equals(a[k], b[k])); | ||
| const entity = changeSets.find(cs => { | ||
@@ -345,0 +346,0 @@ return !res.some(row => compare(Utils.getPrimaryKeyCond(cs.entity, primaryKeys), row, primaryKeys)); |
+4
-2
@@ -156,3 +156,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.1.9-dev.12'; | ||
| static #ORM_VERSION = '7.1.9-dev.13'; | ||
| /** | ||
@@ -466,3 +466,5 @@ * Checks if the argument is instance of `Object`. Returns false for arrays. | ||
| const cond = primaryKeys.reduce((o, pk) => { | ||
| o[pk] = Utils.extractPK(entity[pk]); | ||
| const value = entity[pk]; | ||
| // FKs pointing to a composite PK are arrays, which `extractPK` rejects | ||
| o[pk] = Utils.isPrimaryKey(value, true) ? value : Utils.extractPK(value); | ||
| return o; | ||
@@ -469,0 +471,0 @@ }, {}); |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
1576017
0.02%33676
0.01%