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
- Host: GitHub
- URL: https://github.com/writetome51/error-if-not-primitive-or-array
- Owner: writetome51
- License: mit
- Created: 2019-04-09T05:08:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-09T05:10:30.000Z (almost 7 years ago)
- Last Synced: 2025-01-02T07:26:25.176Z (about 1 year ago)
- Topics: array, error, javascript, message, not, primitive
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
```