JSPM

error-if-not-array

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q47172F
  • License MIT

Function triggers error if argument is not type 'array'

Package Exports

  • error-if-not-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (error-if-not-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

errorIfNotArray(arg): void

Triggers error if arg is not an array.

Example

errorIfNotArray(false);
// Error: "Input must be array"

Installation

npm i error-if-not-array

Loading

// if using TypeScript:
import { errorIfNotArray } from 'error-if-not-array';
// if using ES5 JavaScript:
var errorIfNotArray = require('error-if-not-array').errorIfNotArray;