aureooms/js-tape

View on GitHub
src/fromIterator.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import fromCallable from './fromCallable.js';

/**
 * Converts an iterator to a tape.
 *
 * @function
 * @param {Iterator|AsyncIterator} iterator - The iterator to convert.
 * @returns {Tape} The converted tape.
 */
export default (iterator) => fromCallable(iterator.next.bind(iterator));