UNPKG

augmented-array

Version:

Extends Array methods adding: - combine(array): Object - diff(array): Array - indexByKey(arrayOfObjects): objectOfObjects - intersect(array): Array - pluck(field): Array - range(elements): Array - range(begin, end): Array - subtract(array): Array

14 lines (13 loc) 439 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("mocha"); const chai_1 = require("chai"); require("./index"); const a = [1, 2, 3, 4]; const b = [3, 4, 5, 6]; describe('Array extension functions', () => { it('generates range of numbers', () => { (0, chai_1.expect)(Array.range(4)).to.deep.equal(a.map(x => x - 1)); (0, chai_1.expect)(Array.range(3, 6)).to.deep.equal(b); }); });