File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export * from './flatMap';
1616export * from './flatten' ;
1717export * from './includes' ;
1818export * from './interleave' ;
19+ export * from './isIterable' ;
20+ export * from './iteratorFromIterable' ;
1921export * from './map' ;
2022export * from './merge' ;
2123export * from './range' ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Determines if the provided value adheres to the AsyncIterable protocol.
3+ *
4+ * @param arg Any value
5+ */
16export function isAsyncIterable < T > ( arg : any ) : arg is AsyncIterable < T > {
27 return Boolean ( arg ) && typeof arg [ Symbol . asyncIterator ] === 'function' ;
38}
49
10+ /**
11+ * Determines if the provided value adheres to Iterable protocol.
12+ *
13+ * @param arg Any value
14+ */
515export function isSyncIterable < T > ( arg : any ) : arg is Iterable < T > {
616 return Boolean ( arg ) && typeof arg [ Symbol . iterator ] === 'function' ;
717}
Original file line number Diff line number Diff line change 11import { isAsyncIterable } from './isIterable' ;
22
3+ /**
4+ * Extracts the underlying synchronous or asynchronous iterator from a
5+ * synchronous or asynchronous iterable, respectively.
6+ *
7+ * If the provided value adheres to both the Iterable and AsyncIterable
8+ * protocols, its asynchronous interface will be used.
9+ *
10+ * @param iterable A synchronous or asynchronous iterable.
11+ */
312export function iteratorFromIterable < T > (
413 iterable : Iterable < T > | AsyncIterable < T >
514) : Iterator < T > | AsyncIterator < T > {
You can’t perform that action at this time.
0 commit comments