aureooms/js-tape

View on GitHub
src/toAsyncCallable.js

Summary

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

/**
 * Converts a tape to a callable.
 *
 * @function
 * @param {Tape} tape - The tape to read from.
 * @returns {Function} The converted callable.
 */
export default (tape) => {
    const it = toAsyncIterator(tape);
    return it.next.bind(it);
};