An open API service indexing awesome lists of open source software.

https://github.com/writetome51/error-if-not-primitive-or-array

Function triggers error if argument is neither a primitive type or array
https://github.com/writetome51/error-if-not-primitive-or-array

array error javascript message not primitive

Last synced: 11 months ago
JSON representation

Function triggers error if argument is neither a primitive type or array

Awesome Lists containing this project

README

          

## errorIfNotPrimitiveOrArray(arg): void

Triggers a fatal error if `arg` is not a primitive (number, boolean, or string)
or array.

### Installation
`npm i error-if-not-primitive-or-array`

### Loading
```
// 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;
```