collapse-array
Advanced tools
Comparing version 0.0.1 to 1.0.0
@@ -7,5 +7,6 @@ var collapse = function(array) { | ||
} | ||
return array.length === 1 ? | ||
array[0] : | ||
array | ||
return (l > 1 ? array : | ||
l === 1 ? array[0] : | ||
null | ||
) | ||
} | ||
@@ -12,0 +13,0 @@ |
{ | ||
"name": "collapse-array", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"description": "A simple utility for collapsing single-element arrays.", | ||
@@ -19,5 +19,5 @@ "main": "index.js", | ||
"browsers": { | ||
"ie": [7, 8, 9, 10], | ||
"chrome": [25], | ||
"firefox": [4, 19], | ||
"ie": "6..latest", | ||
"chrome": "latest", | ||
"firefox": [4, 19, "latest"], | ||
"safari": [5.1, 6], | ||
@@ -24,0 +24,0 @@ "opera": [10, 12], |
@@ -8,2 +8,3 @@ var run = require('tape').test | ||
var c = [[[[2],[3]]]] | ||
var d = [] | ||
@@ -13,2 +14,3 @@ test.equal(collapse(a), a) | ||
test.deepEqual(collapse(c), [2, 3]) | ||
test.equal(collapse(d), null) | ||
test.end() | ||
@@ -25,3 +27,4 @@ }) | ||
}, | ||
e: ['bar', ['baz']] | ||
e: ['bar', ['baz']], | ||
f: [[]] | ||
} | ||
@@ -36,3 +39,4 @@ | ||
}, | ||
e: ['bar', 'baz'] | ||
e: ['bar', 'baz'], | ||
f: null | ||
} | ||
@@ -39,0 +43,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3775
6
103
1