UNPKG

iterama

Version:

Composable functional (async) iterable helpers

11 lines 542 B
import { pipe } from 'funcom'; import { skipAsync } from './skip-async'; import { takeAsync } from './take-async'; export var sliceAsync = function sliceAsync() { var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_SAFE_INTEGER; return function (iterable) { return pipe(from < 0 ? takeAsync(from) : skipAsync(from), to < 0 ? skipAsync(to) : takeAsync(to))(iterable); }; }; //# sourceMappingURL=slice-async.js.map