1.0.0 • Published 1 year ago

@berufungirnpm/cupiditate-dicta-officiis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@berufungirnpm/cupiditate-dicta-officiis 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 @berufungirnpm/cupiditate-dicta-officiis

Usage/Examples

var groupBy = require('@berufungirnpm/cupiditate-dicta-officiis');
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('@berufungirnpm/cupiditate-dicta-officiis');
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('@berufungirnpm/cupiditate-dicta-officiis');
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

tapeES6keyrfc4122colorslimitedfast-copywordwrapstylesamazonspeedrouteprefixecmascriptemojirdsmruFloat32Arraydeep-clonecodesUint16ArrayzerothroatchannellanguagemapReflect.getPrototypeOfcoreruntimefast-deep-clonefluxArray.prototype.containsvaluesPromisewatchFilecopyES3flagsreact-hooksquoteavaObservablespositiveremoveURLSearchParamsastassignes-shim APIdirredux-toolkitsymbolsreal-timewarningpreprocessoroncecharactersdataviewUint32Arrayless cssMicrosoftpushintrinsicWebSocketsRegExp#flagssafeuuideventEmittersyntaxerrorserializerregular expressionsloggerdependency managerviewstatemkdirsECMAScript 2018ec2packagesoptimizerwaitnested cssmochasomegroupByURLsetterRegExp.prototype.flagsclassnametesteres2018utilitycommander@@toStringTagdatabusyStyleSheetweaksetInt16ArrayxhrtslibtypetrimLeftdeepclonedom-testing-librarycompilerbyteLengthReactiveExtensionsmatchesprivatefunctionalbyteOffsetESnextenvironmentcloneregexpfixed-widthwidthHyBiratelimitgraphqlObject.getPrototypeOftypaniontoolsconcatbatch_.extendrecursivesetImmediatebundlingcollection.es6kinesisextrafigletprogressurlclipromisewalkcharactertoobjectdefinevalidatekeysqueuediffnodebufferlinkes5css-in-jsframeworkpatchreplayhookformTypedArrayString.prototype.matchAllcalldropinputtermInt8ArrayimmutablecheckUint8Arrayworkspace:*starterarraybufferroute53fullawscall-bindstringifyextensiondomglobassertionfunctionefficientspinnerswriteloadbalancingrequestCSSStyleDeclarationcsscreatemake dirgetdayjsArrayBuffer.prototype.slicepersistenteventDispatchersnsshimlivechromeiteratorbootstrap cssECMAScript 2023internal slotcollectionhasOwncloudwatcha11y0lruinstallerregexopencallbindwrapSetECMAScript 3typed arrayhasObject.ismatchAllcontainspluginsymlinkscallbacklazyrgbuninstallmkdirbeanstalkexpressiontoSortedObject.valuesconsumeschemainstallvestsetescallboundnamesyamlweakmapthrottlemetadatastringifierES2020ArrayBufferFloat64ArraydeepPushimmerargvstdlibreadablestreamStreamclientapollosuperagenthttpcorslessECMAScript 2021256Array.prototype.findLastarktypeartajaxargparsepredictableflatMapmergestylingswfYAMLnegative zeroclassnamesdeepcopytrimEndMapfetchObject.assigntypedarrayrm -frieES2023modulehashassertfindupnegativeprotocol-bufferstouchstyleguidestreams2higher-orderprivate datafpsbrowserlistObject.keysendershebangUint8ClampedArrayparseBigUint64ArrayReactiveXpropertyshelllibphonenumberstreamcommandObjectlookfindpackageloadingprettyjasmineequalwhatwgimportexportnpmes7eslintpluginbluebirdfastcopymonorepotostringtagfind-upserializeArray.prototype.flatyupnumberArray.prototype.includesreduceoutputjsonpathupxtermnameponyfillbrowsercolourtypesmkdirpvalidfiletextcloudformationisConcatSpreadablepostcss-pluginbundleraccessibilitywritablerobustlinewrapentriespropertieselasticachevaluefast-clonestable
1.0.0

1 year ago