@mikro-orm/core
Advanced tools
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "version": "7.1.13-dev.4", | ||
| "version": "7.1.13-dev.5", | ||
| "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
@@ -61,3 +61,3 @@ import type { CompiledFunctions, Dictionary, EntityData, EntityDictionary, EntityKey, EntityMetadata, EntityName, EntityProperty, Primary } from '../typings.js'; | ||
| */ | ||
| static unique<T = string>(items: T[]): T[]; | ||
| static unique<T = string>(items: T[], equals?: (a: T, b: T) => boolean): T[]; | ||
| /** | ||
@@ -64,0 +64,0 @@ * Merges all sources into the target recursively. |
+5
-2
@@ -156,3 +156,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.1.13-dev.4'; | ||
| static #ORM_VERSION = '7.1.13-dev.5'; | ||
| /** | ||
@@ -220,6 +220,9 @@ * Checks if the argument is instance of `Object`. Returns false for arrays. | ||
| */ | ||
| static unique(items) { | ||
| static unique(items, equals) { | ||
| if (items.length < 2) { | ||
| return items; | ||
| } | ||
| if (equals) { | ||
| return items.filter((a, idx) => items.findIndex(b => equals(a, b)) === idx); | ||
| } | ||
| return [...new Set(items)]; | ||
@@ -226,0 +229,0 @@ } |
Sorry, the diff of this file is too big to display
1586316
0.02%33826
0.01%