You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@mikro-orm/core

Package Overview
Dependencies
Maintainers
1
Versions
4159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mikro-orm/core - npm Package Compare versions

Comparing version
7.0.2-dev.7
to
7.0.2-dev.8
+2
-2
metadata/discover-entities.js

@@ -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 });

{
"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": [

@@ -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.