@mikro-orm/core
Advanced tools
@@ -32,3 +32,23 @@ import { Utils } from '../utils/Utils.js'; | ||
| }); | ||
| // Preserve function expressions from indexes/uniques — they can't survive JSON cache serialization | ||
| const expressionMap = new Map(); | ||
| for (const arr of [meta.indexes, meta.uniques]) { | ||
| for (const idx of arr ?? []) { | ||
| if (typeof idx.expression === 'function' && idx.name) { | ||
| expressionMap.set(idx.name, idx.expression); | ||
| } | ||
| } | ||
| } | ||
| Utils.mergeConfig(meta, cache); | ||
| // Restore function expressions that were lost during JSON serialization | ||
| if (expressionMap.size > 0) { | ||
| for (const arr of [meta.indexes, meta.uniques]) { | ||
| for (const idx of arr ?? []) { | ||
| const fn = idx.name && expressionMap.get(idx.name); | ||
| if (fn && typeof idx.expression !== 'function') { | ||
| idx.expression = fn; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
@@ -35,0 +55,0 @@ static useCache() { |
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "type": "module", | ||
| "version": "7.0.0-dev.289", | ||
| "version": "7.0.0-dev.290", | ||
| "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.", | ||
@@ -6,0 +6,0 @@ "exports": { |
+1
-1
@@ -126,3 +126,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.0.0-dev.289'; | ||
| static #ORM_VERSION = '7.0.0-dev.290'; | ||
| /** | ||
@@ -129,0 +129,0 @@ * Checks if the argument is instance of `Object`. Returns false for arrays. |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1275243
0.07%28132
0.07%