@mikro-orm/core 7.0.0-dev.226 → 7.0.0-dev.228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,10 +104,18 @@ export declare class Collection<T extends object, O extends object = object> {
104
104
  * Tests for the existence of an element that satisfies the given predicate.
105
105
  */
106
106
  exists(cb: (item: T) => boolean): boolean;
107
+ /**
108
+ * Returns the first element of this collection that satisfies the predicate.
109
+ */
110
+ find<S extends T>(cb: (item: T, index: number) => item is S): S | undefined;
107
111
  /**
108
112
  * Returns the first element of this collection that satisfies the predicate.
109
113
  */
110
114
  find(cb: (item: T, index: number) => boolean): T | undefined;
115
+ /**
116
+ * Extracts a subset of the collection items.
117
+ */
118
+ filter<S extends T>(cb: (item: T, index: number) => item is S): S[];
111
119
  /**
112
120
  * Extracts a subset of the collection items.
113
121
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
3
  "type": "module",
4
- "version": "7.0.0-dev.226",
4
+ "version": "7.0.0-dev.228",
5
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.",
6
6
  "exports": {
7
7
  "./package.json": "./package.json",
package/utils/Utils.js CHANGED
@@ -123,7 +123,7 @@ export function parseJsonSafe(value) {
123
123
  }
124
124
  export class Utils {
125
125
  static PK_SEPARATOR = '~~~';
126
- static #ORM_VERSION = '7.0.0-dev.226';
126
+ static #ORM_VERSION = '7.0.0-dev.228';
127
127
  /**
128
128
  * Checks if the argument is instance of `Object`. Returns false for arrays.
129
129
  */