UNPKG

es-toolkit

Version:

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

12 lines (9 loc) 265 B
import { compact as compact$1 } from '../../array/compact.mjs'; import { isArrayLike } from '../predicate/isArrayLike.mjs'; function compact(arr) { if (!isArrayLike(arr)) { return []; } return compact$1(Array.from(arr)); } export { compact };