UNPKG

fast-iterable

Version:

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

13 lines (12 loc) 487 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isIterable = void 0; /** * Return true when the informed value is an iterable, and false otherwise * @param value the value to be analyzed * @returns The return is also a type guard, ie, inside an if with that function, the value will be considered an iterable */ function isIterable(value) { return !!(value && typeof value[Symbol.iterator] === 'function'); } exports.isIterable = isIterable;