UNPKG

@prelude/array

Version:

Array module.

14 lines 379 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @returns first element of an array. * @throws if array length is 0. */ const first = (values) => { if (!values.length) { throw new TypeError('Expected non empty array to get first element.'); } return values[0]; }; exports.default = first; //# sourceMappingURL=first.js.map