UNPKG

@codibre/fluent-iterable

Version:

Provides LINQ-like fluent api operations for iterables and async iterables (ES2018+).

16 lines (15 loc) 604 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fluentAsync = fluentAsync; const fluent_async_class_1 = require("./fluent-async-class"); /** * Tranforms an asynchronous iterable into a [[FluentAsyncIterable]]. * @typeparam T The type of the items in the async iterable. * @param iterable The asynchronous iterable instance. * @returns The [[FluentAsyncIterable]] instance. */ function fluentAsync(iterable) { return iterable instanceof fluent_async_class_1.FluentAsyncClass ? iterable : new fluent_async_class_1.FluentAsyncClass(iterable); }