From 0ce85e92caa9d115956237281f7bfaf43dd54139 Mon Sep 17 00:00:00 2001 From: Boris Date: Tue, 20 Dec 2022 12:54:58 +0300 Subject: [PATCH] fix(core): allow adding array of refs to collection (#3859) just small fix for type Co-authored-by: Boris Damiryan --- packages/core/src/entity/Collection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/entity/Collection.ts b/packages/core/src/entity/Collection.ts index 4f3b3eca9c5c..48ef492bd506 100644 --- a/packages/core/src/entity/Collection.ts +++ b/packages/core/src/entity/Collection.ts @@ -118,7 +118,7 @@ export class Collection extends Arr return super.toJSON(); } - add(entity: T | Reference | T[], ...entities: (T | Reference)[]): void { + add(entity: T | Reference | (T | Reference)[], ...entities: (T | Reference)[]): void { entities = Utils.asArray(entity).concat(entities); const unwrapped = entities.map(i => Reference.unwrapReference(i)) as T[]; unwrapped.forEach(entity => this.validateItemType(entity));