Socket
Socket
Sign inDemoInstall

array-back

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-back - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

24

lib/array-back.js

@@ -1,3 +0,3 @@

"use strict";
var t = require("typical");
'use strict'
var t = require('typical')

@@ -7,5 +7,5 @@ /**

@example
var arrayify = require("array-back");
var arrayify = require("array-back")
*/
module.exports = arrayify;
module.exports = arrayify

@@ -40,10 +40,10 @@ /**

*/
function arrayify(input){
if (input === undefined){
return [];
} else if (t.isArrayLike(input)){
return Array.prototype.slice.call(input);
} else {
return Array.isArray(input) ? input : [ input ];
}
function arrayify (input) {
if (input === undefined) {
return []
} else if (t.isArrayLike(input)) {
return Array.prototype.slice.call(input)
} else {
return Array.isArray(input) ? input : [ input ]
}
}
{
"name": "array-back",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "1.0.2",
"version": "1.0.3",
"description": "Guarantees an array back",

@@ -24,8 +24,8 @@ "repository": "https://github.com/75lb/array-back.git",

"dependencies": {
"typical": "^2.2.0"
"typical": "^2.4.2"
},
"devDependencies": {
"jsdoc-to-markdown": "^1.1.1",
"tape": "^4.0.0"
"jsdoc-to-markdown": "^1.3.3",
"tape": "^4.5.1"
}
}
[![view on npm](http://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back)
[![npm module downloads per month](http://img.shields.io/npm/dm/array-back.svg)](https://www.npmjs.org/package/array-back)
[![npm module downloads](http://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back)
[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back)
[![Dependency Status](https://david-dm.org/75lb/array-back.svg)](https://david-dm.org/75lb/array-back)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
<a name="module_array-back"></a>
## array-back
**Example**
```js
var arrayify = require("array-back");
var arrayify = require("array-back")
```
<a name="exp_module_array-back--arrayify"></a>
### arrayify(input) ⇒ <code>Array</code> ⏏

@@ -48,2 +51,2 @@ Takes any input and guarantees an array back.

&copy; 2015 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).
&copy; 2015-16 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

@@ -1,17 +0,17 @@

"use strict";
var test = require("tape");
var arrayify = require("../");
'use strict'
var test = require('tape')
var arrayify = require('../')
test("arrayify()", function(t){
t.deepEqual(arrayify(undefined), []);
t.deepEqual(arrayify(null), [ null ]);
t.deepEqual(arrayify(0), [ 0 ]);
t.deepEqual(arrayify([ 1, 2 ]), [ 1, 2 ]);
function func(){
t.deepEqual(arrayify(arguments), [ 1, 2, 3 ]);
}
func(1, 2, 3);
test('arrayify()', function (t) {
t.deepEqual(arrayify(undefined), [])
t.deepEqual(arrayify(null), [ null ])
t.deepEqual(arrayify(0), [ 0 ])
t.deepEqual(arrayify([ 1, 2 ]), [ 1, 2 ])
t.end();
});
function func () {
t.deepEqual(arrayify(arguments), [ 1, 2, 3 ])
}
func(1, 2, 3)
t.end()
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc