npm

array-pair
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

array-pair

NPM NPM CircleCI

JavaScript array pairing and merging function written in TypeScript with 100% code coverage and strict typing definitions.

Usage

    npm install array-pair --save
    var expect = require("chai").expect;
    var pair = require("array-pair");
 
    var names = [ "Bob", "John", "Joe" ];
    var ages = [ 43, 28, 21 ];
    var merged = pair(names, ages);
 
    expect(merged).to.deep.equals([
        [ "Bob", 43 ],
        [ "John", 28 ],
        [ "Joe", 21 ]
    ]);

Build & Develop

    npm run build # Invoke the build process via NPM script proxy. 
    gulp build # Invoke the build process directly via Gulp. 

Testing

array-pair uses a combination of mocha and chai for local code tests, and CircleCI for continuous integration.

array-pair is written in TypeScript, but its tests are written in JavaScript as this removes dependencies and makes continuous integration much easier. The disadvantage is that this requires array-pair to be built before it can be tested.

To test array-pair, run the following npm script:

    npm test

The command will invoke the build process and await its completion before executing the tests. The tests will emit coverage reports and temporary information to files in the folders .nyc_output/ and coverage/ for upload to a code coverage manager such as CodeCov.

License

See the LICENSE file for license information.

Readme

Keywords

Package Sidebar

Install

npm i array-pair

Weekly Downloads

0

Version

0.5.0

License

MIT

Last publish

Collaborators

  • mgthomas99