diff --git a/src/Buffer.spec.ts b/src/Buffer.spec.ts index c8a31061..132e0152 100644 --- a/src/Buffer.spec.ts +++ b/src/Buffer.spec.ts @@ -75,7 +75,7 @@ describe('Buffer', () => { }); it('constructs from an iterable', () => { - const q = Buffer.from([1, 2, 3], 2); + const q: Iterable = Buffer.from([1, 2, 3], 2); expect([...q]).toEqual([2, 3]); }); diff --git a/src/Buffer.ts b/src/Buffer.ts index 9364a7db..42bd4178 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -61,10 +61,11 @@ export default class Buffer { return this.length > 0 ? { value: this.dequeue(), - done: false, + done: false as const, } : { - done: true, + done: true as const, + value: undefined, }; }, [Symbol.iterator]() {