From ff7ffd84dcc5902645d6ffa2c8a1095e442811c7 Mon Sep 17 00:00:00 2001 From: Rami <72725910+ramikg@users.noreply.github.com> Date: Thu, 30 May 2024 14:41:47 +0300 Subject: [PATCH 1/2] Fix for loop on `Result` instance --- lib/mapping/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mapping/index.d.ts b/lib/mapping/index.d.ts index 694e789cf..86e7b238f 100644 --- a/lib/mapping/index.d.ts +++ b/lib/mapping/index.d.ts @@ -51,6 +51,8 @@ export namespace mapping { forEach(callback: (currentValue: T, index: number) => void, thisArg?: any): void; toArray(): T[]; + + [Symbol.iterator](): Iterator; } type MappingExecutionOptions = { From 339b6b4e828a7e80dd71a9e9a86f5d279f599d13 Mon Sep 17 00:00:00 2001 From: Rami <72725910+ramikg@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:45:33 +0300 Subject: [PATCH 2/2] Make `Result` an `IterableIterator` --- lib/mapping/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/mapping/index.d.ts b/lib/mapping/index.d.ts index 86e7b238f..528d9b158 100644 --- a/lib/mapping/index.d.ts +++ b/lib/mapping/index.d.ts @@ -43,7 +43,7 @@ export namespace mapping { newObjectInstance(): any; } - interface Result extends Iterator { + interface Result extends IterableIterator { wasApplied(): boolean; first(): T | null; @@ -51,8 +51,6 @@ export namespace mapping { forEach(callback: (currentValue: T, index: number) => void, thisArg?: any): void; toArray(): T[]; - - [Symbol.iterator](): Iterator; } type MappingExecutionOptions = {