Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

combine-arrays

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combine-arrays - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.travis.yml

2

package.json
{
"name": "combine-arrays",
"version": "1.0.1",
"version": "1.0.2",
"description": "For people who hate for loops and want to iterate over multiple arrays with a single function",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,21 +8,39 @@

var combine = require('combine-arrays')
```js
var combine = require('combine-arrays')
var ary1 = ['what', 'what', 'in', 'the', 'butt']
var ary2 = ['ho', 'hi', 'hup', 'hurr', 'HAH', '...huh?']
var ary1 = ['what', 'what', 'in', 'the', 'butt']
var ary2 = ['ho', 'hi', 'hup', 'hurr', 'HAH', '...huh?']
var output = combine({
first: ary1,
second: ary2
})
var output = combine({
first: ary1,
second: ary2
})
console.log(output)
// [ { first: 'what', second: 'ho' },
// { first: 'what', second: 'hi' },
// { first: 'in', second: 'hup' },
// { first: 'the', second: 'hurr' },
// { first: 'butt', second: 'HAH' },
// { first: undefined, second: '...huh?' } ]
console.log(output)
// [ { first: 'what', second: 'ho' },
// { first: 'what', second: 'hi' },
// { first: 'in', second: 'hup' },
// { first: 'the', second: 'hurr' },
// { first: 'butt', second: 'HAH' },
// { first: undefined, second: '...huh?' } ]
```
```js
var combine = require('combine-arrays')
var output = combine([
['a', 'ax', 'app', 'ache', 'anger'],
['b', 'be', 'bin'],
['c', 'ci', 'cat', 'cool', 'chant']
])
console.log(output)
// [ { 0: 'a', 1: 'b', 2: 'c' },
// { 0: 'ax', 1: 'be', 2: 'ci' },
// { 0: 'app', 1: 'bin', 2: 'cat' },
// { 0: 'ache', 1: undefined, 2: 'cool' },
// { 0: 'anger', 1: undefined, 2: 'chant' } ]
```
License

@@ -29,0 +47,0 @@ ======

@@ -14,7 +14,7 @@ var test = require('tape')

t.deepEqual(output, [ { first: 'what', second: 'ho' },
{ first: 'what', second: 'hi' },
{ first: 'in', second: 'hup' },
{ first: 'the', second: 'hurr' },
{ first: 'butt', second: 'HAH' },
{ first: undefined, second: '...huh?' } ])
{ first: 'what', second: 'hi' },
{ first: 'in', second: 'hup' },
{ first: 'the', second: 'hurr' },
{ first: 'butt', second: 'HAH' },
{ first: undefined, second: '...huh?' } ])

@@ -63,1 +63,24 @@ t.end()

})
test('array example from the readme', function(t) {
var output = combine([
['a', 'ax', 'app', 'ache', 'anger'],
['b', 'be', 'bin'],
['c', 'ci', 'cat', 'cool', 'chant']
])
var expectedOutput = [
[ 'a', 'b', 'c' ],
[ 'ax', 'be', 'ci' ],
[ 'app', 'bin', 'cat' ],
[ 'ache', undefined, 'cool' ],
[ 'anger', undefined, 'chant']
]
t.deepEqual(output, expectedOutput)
t.ok(Array.isArray(output), 'Output is an array')
t.equal(output.length, expectedOutput.length)
t.end()
})
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