Converts all items in the collection to plain DTO objects.
()
| 569 | |
| 570 | /** Converts all items in the collection to plain DTO objects. */ |
| 571 | toArray<TT extends T>(): EntityDTO<TT>[] { |
| 572 | if (this.#items.size === 0) { |
| 573 | return []; |
| 574 | } |
| 575 | |
| 576 | return this.map(item => wrap(item as TT).toJSON()); |
| 577 | } |
| 578 | |
| 579 | /** Returns the primary key values (or a specific field) of all items in the collection. */ |
| 580 | getIdentifiers<U extends IPrimaryKey = Primary<T> & IPrimaryKey>(field?: string | string[]): U[] { |