UNPKG

@thi.ng/arrays

Version:

Array / Arraylike utilities

9 lines (8 loc) 224 B
import { illegalArgs } from "@thi.ng/errors/illegal-arguments"; const ensureIterable = (x) => { (x == null || !x[Symbol.iterator]) && illegalArgs(`value is not iterable: ${x}`); return x; }; export { ensureIterable };