UNPKG

nx

Version:

The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.

19 lines (18 loc) 680 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isAsyncIterator = isAsyncIterator; exports.getLastValueFromAsyncIterableIterator = getLastValueFromAsyncIterableIterator; function isAsyncIterator(v) { return typeof v?.[Symbol.asyncIterator] === 'function'; } async function getLastValueFromAsyncIterableIterator(i) { let prev; let current; const generator = i[Symbol.asyncIterator] || i[Symbol.iterator]; const iterator = generator.call(i); do { prev = current; current = await iterator.next(); } while (!current.done); return current.value !== undefined || !prev ? current.value : prev.value; }