Skip to content

Commit 11f25e8

Browse files
authored
[form] Fix errors iterator (#254)
1 parent d275875 commit 11f25e8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.changeset/red-turtles-juggle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sjsf/form": patch
3+
---
4+
5+
Fix errors iterator

packages/form/src/form/internals.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@ export class FormErrors {
147147
this.#map.clear();
148148
}
149149

150-
*[Symbol.iterator]() {
151-
const casted: [FieldPath, string[]] = [[] as RPath as FieldPath, []];
150+
*[Symbol.iterator](): Generator<[FieldPath, string[]]> {
152151
for (const pair of this.#map) {
153-
casted[0] = pair[0];
154-
casted[1] = pair[1].array;
155-
yield casted;
152+
yield [pair[0], pair[1].array];
156153
}
157154
}
158155
}

0 commit comments

Comments
 (0)