2.5.33 • Published 1 year ago
@kollorg/explicabo-dignissimos-a v2.5.33
@kollorg/explicabo-dignissimos-a 
An ESnext spec-compliant Object.groupBy
shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.
Getting started
npm install --save @kollorg/explicabo-dignissimos-a
Usage/Examples
var groupBy = require('@kollorg/explicabo-dignissimos-a');
var assert = require('assert');
var arr = [0, 1, 2, 3, 4, 5];
var parity = function (x) { return x % 2 === 0 ? 'even' : 'odd'; };
var results = groupBy(arr, function (x, i) {
assert.equal(x, arr[i]);
return parity(x);
});
assert.deepEqual(results, {
__proto__: null,
even: [0, 2, 4],
odd: [1, 3, 5],
});
var groupBy = require('@kollorg/explicabo-dignissimos-a');
var assert = require('assert');
/* when Object.groupBy is not present */
delete Object.groupBy;
var shimmed = groupBy.shim();
assert.equal(shimmed, groupBy.getPolyfill());
assert.deepEqual(Object.groupBy(arr, parity), groupBy(arr, parity));
var groupBy = require('@kollorg/explicabo-dignissimos-a');
var assert = require('assert');
/* when Array#group is present */
var shimmed = groupBy.shim();
assert.equal(shimmed, Object.groupBy);
assert.deepEqual(Object.groupBy(arr, parity), groupBy(arr, parity));
Tests
Simply clone the repo, npm install
, and run npm test
2.5.29
1 year ago
2.4.17
1 year ago
2.5.25
1 year ago
2.4.14
1 year ago
2.5.26
1 year ago
2.5.27
1 year ago
2.4.16
1 year ago
2.5.28
1 year ago
2.4.15
1 year ago
2.5.21
1 year ago
2.5.22
1 year ago
2.5.23
1 year ago
2.5.24
1 year ago
2.5.20
1 year ago
2.5.18
1 year ago
2.5.19
1 year ago
2.5.17
1 year ago
2.3.14
1 year ago
2.5.32
1 year ago
2.5.33
1 year ago
2.5.30
1 year ago
2.5.31
1 year ago
2.3.13
1 year ago
2.3.12
1 year ago
2.2.11
1 year ago
2.2.10
1 year ago
2.3.11
1 year ago
2.2.9
1 year ago
2.1.9
1 year ago
2.0.9
1 year ago
2.0.8
1 year ago
2.0.7
1 year ago
2.0.6
1 year ago
2.0.5
1 year ago
1.0.5
1 year ago
1.0.4
1 year ago
1.0.2
1 year ago
1.0.3
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago