1.0.6 • Published 6 days ago

@teamteanpm2024/odit-maxime-voluptas v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

@teamteanpm2024/odit-maxime-voluptas Version Badge

github actions coverage License Downloads

npm badge

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 @teamteanpm2024/odit-maxime-voluptas

Usage/Examples

var groupBy = require('@teamteanpm2024/odit-maxime-voluptas');
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('@teamteanpm2024/odit-maxime-voluptas');
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('@teamteanpm2024/odit-maxime-voluptas');
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

javascriptroute53configurablevalidless.jsapitacitsequenceargparsemimetypesInt8ArraygetoptisConcatSpreadableWeakSetInt32Arrayamazonpackageoutputemojicode pointssearchbluebirdtouchES5offsetasciiio-tstoStringTagartconcat@@toStringTagtimepackagesfigletFunction.prototype.name.envnativeassertscloudfrontwalkingconsolescheme-validationfsmochaconfigtoArrayES2023json-schema-validationstyled-componentsfullsortArray.prototype.findLastObject.getPrototypeOfdirectoryanimationArray.prototype.flattenpurerm -frfullwidthcolumnspopmotionwriteUnderscorestructuredClonechaiviewestreelogObject.keysbalancedsyntaxexecpasswordregexpbyteECMAScript 2021compilerlook-upreadablestreamzodnumberstylesheetweaksetes6bootstrap cssemrmruArray.prototype.containschrometrimRightprototypedataES8variablesArray.prototype.findLastIndexsanitizationbundlerconnectclassnamelibphonenumberES2015whatwgpromisewebimmutablecolourflatMapcss nestingstatelessArrayBufferhttpcall-bindsyntaxerrorargvpropfixed-widthchanneles-shim APIoptimizerformsfastairbnbfastclonemodulestoolkitposebyteOffsetparsingRFC-6455Object.valuesFloat32ArraywarningrmdirsharedarraybuffertrimEndtypanionsigintObject.fromEntriesgradients cssworkspace:*MicrosoftnodejsexpressionReactiveExtensionsReactiveXstreamsoperating-systemlesstapgetvalidatorinternalBigUint64Arrayfast-deep-copyquotecollection.es6findLastgetOwnPropertyDescriptordataViewserializerkeyregular expressionsdebuggerlesscssduplexterminalquerydescriptorsslotproxyjsontypesymbolworkflowpositiveObject.assignframeworkframerpushcachephoneschematoolscallbackmulti-packagelanguagereact-testing-librarymimewgettslibiteraterobustbcryptpostcss-plugintranspilerpackage managerastloggersliceES2021dom-testing-librarymapreducedirshebanglockfilequeueesdependenciesfetchECMAScript 2023rgbspeednested cssformathookformdatastructurepipeutil.inspecttasktestingfast-cloneless mixinssafeemitSymbol.toStringTagBigInt64ArrayArray.prototype.filternodefast-copyparseinterruptspoint-freebatchequalitytrimStartpolyfilles-abstractencryptionparentsnsECMAScript 2018statuscoercibleclassesECMAScript 5harmonyMapexitcharacterscommand-lineenvnegativeec2negative zeroextraspinnerECMAScript 7cors
1.0.6

6 days ago

1.0.5

7 days ago

1.0.4

8 days ago

1.0.3

9 days ago

1.0.2

10 days ago

1.0.1

11 days ago

1.0.0

11 days ago