Socket
Socket
Sign inDemoInstall

castarray

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    castarray

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


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
2.32 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 25 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc