From 88b3add561cec8c4c7f56c8af9f49377cf2937d1 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 4 Sep 2019 12:47:12 +0200 Subject: [PATCH] fix type errors occurring in tsc >= 3.6 --- iterator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iterator.js b/iterator.js index 9cffd02..c5e0c52 100644 --- a/iterator.js +++ b/iterator.js @@ -2,7 +2,7 @@ * @template T,R * @param {Iterator} iterator * @param {function(T):R} f - * @return {Iterator} + * @return {IterableIterator} */ export const mapIterator = (iterator, f) => ({ /** @@ -14,13 +14,13 @@ export const mapIterator = (iterator, f) => ({ // @ts-ignore next () { const r = iterator.next() - return r.done ? { value: r.done ? undefined : f(r.value), done: r.done } : { value: f(r.value), done: false } + return { value: r.done ? undefined : f(r.value), done: r.done } } }) /** * @template T - * @param {function():{done:boolean,value:T|undefined}} next + * @param {function():IteratorResult} next * @return {IterableIterator} */ export const createIterator = next => ({