🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

arfy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arfy

Ensures that something is array

1.0.1
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

arfy

Ensures that something is array

Build Status NPM version

Install

npm i arfy

Usage

const arfy = require('arfy');

console.log(arfy('test'));               // ['test']
console.log(arfy(['test']));             // ['test']
console.log(arfy(['test1', 'test2']));   // ['test1', 'test2']
console.log(arfy());                     // []
console.log(arfy(null));                 // []

console.log(arfy('test1', 'test2'));               // ['test1', 'test2']
console.log(arfy(['test1'], ['test2']));           // ['test1', 'test2']
console.log(arfy('test1', ['test2', 'test3']));    // ['test1', 'test2', 'test3']
console.log(arfy(['test1', 'test2'], [], null));   // ['test1', 'test2']
console.log(arfy(['test', ['test']]));             // ['test', ['test']]

console.log(arfy(123));            // [123]
console.log(arfy({a: 1, b: 2}));   // [{a: 1, b: 2}]
console.log(arfy(true));           // [true]
console.log(arfy(false));          // [false]

License

MIT

Keywords

array

FAQs

Package last updated on 18 Aug 2018

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