@mikro-orm/core
Advanced tools
@@ -12,3 +12,3 @@ import { basename } from 'node:path'; | ||
| for (const item of targets) { | ||
| if (item instanceof EntitySchema) { | ||
| if (EntitySchema.is(item)) { | ||
| for (const item2 of targets) { | ||
@@ -22,3 +22,3 @@ if (item.meta.class === item2) { | ||
| for (const item of targets) { | ||
| const validTarget = item instanceof EntitySchema || (item instanceof Function && MetadataStorage.isKnownEntity(item.name)); | ||
| const validTarget = EntitySchema.is(item) || (item instanceof Function && MetadataStorage.isKnownEntity(item.name)); | ||
| if (validTarget && !allTargets.has(item)) { | ||
@@ -25,0 +25,0 @@ allTargets.set(item, path); |
@@ -57,2 +57,8 @@ import { EntityMetadata, type AnyEntity, type EntityKey, type Constructor, type DeepPartial, type EntityName, type EntityProperty, type CleanKeys, type ExpandProperty, type IsNever, type EntityCtor } from '../typings.js'; | ||
| constructor(meta: EntitySchemaMetadata<Entity, Base, Class>); | ||
| /** | ||
| * Checks if the given value is an EntitySchema instance, using duck-typing | ||
| * as a fallback when `instanceof` fails due to CJS/ESM dual-package hazard | ||
| * (e.g. when using `tsx` or `@swc-node/register` with `"type": "commonjs"` projects). | ||
| */ | ||
| static is(item: unknown): item is EntitySchema; | ||
| static fromMetadata<T = AnyEntity, U = never>(meta: EntityMetadata<T> | DeepPartial<EntityMetadata<T>>): EntitySchema<T, U>; | ||
@@ -59,0 +65,0 @@ addProperty(name: EntityKey<Entity>, type?: TypeType, options?: PropertyOptions<Entity> | EntityProperty<Entity>): void; |
@@ -30,2 +30,13 @@ import { EntityMetadata, } from '../typings.js'; | ||
| } | ||
| /** | ||
| * Checks if the given value is an EntitySchema instance, using duck-typing | ||
| * as a fallback when `instanceof` fails due to CJS/ESM dual-package hazard | ||
| * (e.g. when using `tsx` or `@swc-node/register` with `"type": "commonjs"` projects). | ||
| */ | ||
| static is(item) { | ||
| if (item instanceof EntitySchema) { | ||
| return true; | ||
| } | ||
| return item != null && typeof item === 'object' && item.constructor?.name === 'EntitySchema' && 'meta' in item; | ||
| } | ||
| static fromMetadata(meta) { | ||
@@ -32,0 +43,0 @@ const schema = new EntitySchema({ ...meta, internal: true }); |
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "version": "7.0.2-dev.7", | ||
| "version": "7.0.2-dev.8", | ||
| "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": [ |
+1
-1
@@ -126,3 +126,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.0.2-dev.7'; | ||
| static #ORM_VERSION = '7.0.2-dev.8'; | ||
| /** | ||
@@ -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
1282037
0.06%28586
0.06%