Skip to content

Commit 9b1fbc0

Browse files
committed
Add types for built-in iterator
1 parent 370f2e6 commit 9b1fbc0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

test/types/record.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ const record2Entries: IterableIterator<[string, any]> = record2.entries()
4343
const record1Values: IterableIterator<any> = record1.values()
4444
const record2Values: IterableIterator<any> = record2.values()
4545

46+
const record1ToArray: any[] = [...record1]
47+
const record2ToArray: any[] = [...record2]
48+
4649
const record1Has: boolean = record1.has(42)
4750
const record2Has: boolean = record1.has('key')
4851

types/record.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ declare class Record {
3939

4040
values(): IterableIterator<Object>
4141

42+
[Symbol.iterator](): IterableIterator<Object>
43+
4244
toObject(): object
4345

4446
get(key: string | number): any

0 commit comments

Comments
 (0)