Skip to content

Commit

Permalink
fix(Buffer): iterable types
Browse files Browse the repository at this point in the history
  • Loading branch information
slikts committed Jan 24, 2023
1 parent df6785e commit 92717d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Buffer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('Buffer', () => {
});

it('constructs from an iterable', () => {
const q = Buffer.from([1, 2, 3], 2);
const q: Iterable<number> = Buffer.from([1, 2, 3], 2);
expect([...q]).toEqual([2, 3]);
});

Expand Down
5 changes: 3 additions & 2 deletions src/Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ export default class Buffer<A> {
return this.length > 0
? {
value: this.dequeue(),
done: false,
done: false as const,
}
: {
done: true,
done: true as const,
value: undefined,
};
},
[Symbol.iterator]() {
Expand Down

0 comments on commit 92717d8

Please sign in to comment.