castarray

1.0.0 • Public • Published

castarray

Ensure a value is an array and wrap it if it is not an array

This is a fork of cast-array by Ben Drucker without support for IE8.

Install

$ npm install --save castarray

Usage

var castArray = require('castarray')

castArray('input')
//=> ['input']

castArray(['input'])
//=> ['input']

API

castArray(value) -> array

value

Required
Type: array / any

A value to wrap in an array (unless it's already an array).

License

MIT © Sam Gluck

/castarray/

    Package Sidebar

    Install

    npm i castarray

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • sdgluck