New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

collapse-array

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collapse-array - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

.npmignore

7

index.js

@@ -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 @@

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