UNPKG

error-if-not-array

Version:

Function triggers error if argument is not array

4 lines (3 loc) 110 B
export function errorIfNotArray(arg) { if (!(Array.isArray(arg))) throw new Error('Input must be array.'); }