🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

lazy-arrayify

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-arrayify

We are lazy, also [lazy-cache][]-d and [browserify][]-ready - just arrayify, falsey values returns empty array.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
42
-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

lazy-arrayify npmjs.com The MIT License npm downloads

We are lazy, also lazy-cache-d and browserify-ready - just arrayify, falsey values returns empty array.

code climate standard code style travis build status coverage status dependency status

Install

npm i lazy-arrayify --save

Usage

For more use-cases see the tests

const lazyArrayify = require('lazy-arrayify')

.lazyArrayify

Returns empty array on falsey values.

Params

  • val {Mixed}
  • returns {Array}

Example

var arrayify = require('lazy-arrayify')

console.log(arrayify(1234))        // => [1234]
console.log(arrayify('str'))       // => ['str']
console.log(arrayify(null))        // => []
console.log(arrayify())            // => []
console.log(arrayify(0))           // => []
console.log(arrayify(false))       // => []
console.log(arrayify([null, 123])) // => [null, 123]
console.log(arrayify([false]))     // => [false]

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

arr

FAQs

Package last updated on 29 Apr 2016

Did you know?

Socket

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