array-interweave

1.0.0 • Public • Published

array-interweave

js-standard-style Build Status Code Climate codecov.io Dependency Status devDependency Status

NPM

Produce a new array from two source arrays with alternating values from each source array.

Installation

$ npm install array-interweave --save

Usage

const interweave = require('array-interweave')
const sourceA = [1, 2, 3, 4, 5]
const sourceB = ['A', 'B', 'C']
const mergedResult = interweave(sourceA, sourceB)
// => [1, 'A', 2, 'B', 3, 'C', 4, 5]
const interweave = require('array-interweave')
const sourceA = [0x55, {foo: 'bar'}, 'apples']
const sourceB = [1, 2, 3, 4, 5]
const mergedResult = interweave(sourceA, sourceB)
// => [0x55, 1, {foo: 'bar'}, 2, 'apples', 3, 4, 5]

Tests

iUnit tests use Mocha, Unit.js, and Istanbul

$ npm run test
$ npm run test-html-cov # Will open HTML coverage report in Google Chrome on OSX 

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i array-interweave

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • cflynn07