UNPKG

fast-iterable

Version:

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

13 lines (12 loc) 369 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.whenEmpty = void 0; const execute_1 = require("./execute"); function* whenEmpty(fallbackIterable) { let fallback = true; yield* execute_1.execute.call(this, () => (fallback = false)); if (fallback) { yield* fallbackIterable; } } exports.whenEmpty = whenEmpty;