UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

13 lines (10 loc) 303 B
import { head as head$1 } from '../../array/head.mjs'; import { toArray } from '../_internal/toArray.mjs'; import { isArrayLike } from '../predicate/isArrayLike.mjs'; function head(arr) { if (!isArrayLike(arr)) { return undefined; } return head$1(toArray(arr)); } export { head };