Triggers a fatal error if arg
is not a primitive (number, boolean, or string)
or array.
npm i error-if-not-primitive-or-array
// if using TypeScript:
import {errorIfNotPrimitiveOrArray} from 'error-if-not-primitive-or-array';
// if using ES5 JavaScript:
var errorIfNotPrimitiveOrArray =
require('error-if-not-primitive-or-array').errorIfNotPrimitiveOrArray;