diff --git a/src/chain.js b/src/chain.js index 74d49b2..6664506 100644 --- a/src/chain.js +++ b/src/chain.js @@ -1,5 +1,5 @@ import fromAsyncIterable from './fromAsyncIterable' ; -import toIterable from './toIterable' ; +import toAsyncIterable from './toAsyncIterable' ; import asyncIterableChain from './asyncIterableChain' ; import asyncIterableMap from './asyncIterableMap' ; @@ -9,6 +9,6 @@ import asyncIterableMap from './asyncIterableMap' ; */ export default function chain ( stream ) { - return fromAsyncIterable( asyncIterableChain( asyncIterableMap( toIterable , toIterable( stream ) ) ) ) ; + return fromAsyncIterable( asyncIterableChain( asyncIterableMap( toAsyncIterable , toAsyncIterable( stream ) ) ) ) ; } diff --git a/src/index.js b/src/index.js index f252588..b76138f 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ import skip from './skip' ; import split from './split' ; import toArray from './toArray' ; import toCallable from './toCallable' ; -import toIterable from './toIterable' ; +import toAsyncIterable from './toAsyncIterable' ; import toIterator from './toIterator' ; import toString from './toString' ; @@ -41,7 +41,7 @@ export default { split , toArray , toCallable , - toIterable , + toAsyncIterable , toIterator , toString , } ; @@ -66,7 +66,7 @@ export { split , toArray , toCallable , - toIterable , + toAsyncIterable , toIterator , toString , } ; diff --git a/src/map.js b/src/map.js index a28279e..575d3bc 100644 --- a/src/map.js +++ b/src/map.js @@ -1,5 +1,5 @@ import fromAsyncIterable from './fromAsyncIterable' ; -import toIterable from './toIterable' ; +import toAsyncIterable from './toAsyncIterable' ; import asyncIterableMap from './asyncIterableMap' ; /** @@ -9,6 +9,6 @@ import asyncIterableMap from './asyncIterableMap' ; */ export default function map ( callable , stream ) { - return fromAsyncIterable( asyncIterableMap( callable , toIterable( stream ) ) ) ; + return fromAsyncIterable( asyncIterableMap( callable , toAsyncIterable( stream ) ) ) ; } diff --git a/src/toArray.js b/src/toArray.js index 2700017..bcabc2d 100644 --- a/src/toArray.js +++ b/src/toArray.js @@ -1,4 +1,4 @@ -import toIterable from './toIterable' ; +import toAsyncIterable from './toAsyncIterable' ; import asyncIterableToArray from './asyncIterableToArray' ; /** @@ -6,4 +6,4 @@ import asyncIterableToArray from './asyncIterableToArray' ; * @kind function * @param {Stream} stream the stream to read from */ -export default async stream => asyncIterableToArray( toIterable( stream ) ) ; +export default async stream => asyncIterableToArray( toAsyncIterable( stream ) ) ; diff --git a/src/toIterable.js b/src/toAsyncIterable.js similarity index 78% rename from src/toIterable.js rename to src/toAsyncIterable.js index 390d4d2..1874d17 100644 --- a/src/toIterable.js +++ b/src/toAsyncIterable.js @@ -2,7 +2,7 @@ * Converts a stream to an iterable. * @param {Stream} stream the stream to read from */ -export default async function* toIterable ( stream ) { +export default async function* toAsyncIterable ( stream ) { while ( true ) { diff --git a/src/toIterator.js b/src/toIterator.js index f79d013..3f376ff 100644 --- a/src/toIterator.js +++ b/src/toIterator.js @@ -1,8 +1,8 @@ -import toIterable from './toIterable' ; +import toAsyncIterable from './toAsyncIterable' ; /** * Converts a stream to an iterator. * @kind function * @param {Stream} stream the stream to read from */ -export default stream => toIterable( stream )[Symbol.asyncIterator]( ) ; +export default stream => toAsyncIterable( stream )[Symbol.asyncIterator]( ) ;