JSPM

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

We are lazy, also [lazy-cache][]d and [browserify][]-ready - just arrayify, falsey values returns empty array. In bonus with `.isArray` method.

Package Exports

  • lazy-arrayify
  • lazy-arrayify/arrayify
  • lazy-arrayify/isarray

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 (lazy-arrayify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lazy-arrayify npmjs.com The MIT License npm downloads

We are lazy, also lazy-cached and browserify-ready - just arrayify, falsey values returns empty array. In bonus with .isArray method.

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')

.isArray

Check if value is array using the isarray module.

Params

  • val {Mixed}
  • returns {Boolean}

Example

var isArray = require('lazy-arrayify').isArray

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

.arrayify

Returns empty array on falsey values.

Params

  • val {Mixed}
  • returns {Array}

Example

var arrayify = require('lazy-arrayify').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