UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

23 lines (22 loc) 524 B
import { purry } from './purry'; export function first() { return purry(_first, arguments, first.lazy); } function _first(array) { return array[0]; } (function (first) { function lazy() { return function (value) { return { done: true, hasNext: true, next: value, }; }; } first.lazy = lazy; (function (lazy) { lazy.single = true; })(lazy = first.lazy || (first.lazy = {})); })(first || (first = {}));