Skip to content

sdgluck/castarray

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%