2.2.10 • Published 2 days ago

@juigorg/deserunt-occaecati-mollitia v2.2.10

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

@juigorg/deserunt-occaecati-mollitia Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2019 spec-compliant Array.prototype.flatMap 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 spec.

Because Array.prototype.flatMap depends on a receiver (the this value), the main export takes the array to operate on as the first argument.

Getting started

npm install --save @juigorg/deserunt-occaecati-mollitia

Usage/Examples

var flatMap = require('@juigorg/deserunt-occaecati-mollitia');
var assert = require('assert');

var arr = [1, [2], [], 3];

var results = flatMap(arr, function (x, i) {
	assert.equal(x, arr[i]);
	return x;
});

assert.deepEqual(results, [1, 2, 3]);
var flatMap = require('@juigorg/deserunt-occaecati-mollitia');
var assert = require('assert');
/* when Array#flatMap is not present */
delete Array.prototype.flatMap;
var shimmedFlatMap = flatMap.shim();

var mapper = function (x) { return [x, 1]; };

assert.equal(shimmedFlatMap, flatMap.getPolyfill());
assert.deepEqual(arr.flatMap(mapper), flatMap(arr, mapper));
var flatMap = require('@juigorg/deserunt-occaecati-mollitia');
var assert = require('assert');
/* when Array#flatMap is present */
var shimmedIncludes = flatMap.shim();

var mapper = function (x) { return [x, 1]; };

assert.equal(shimmedIncludes, Array.prototype.flatMap);
assert.deepEqual(arr.flatMap(mapper), flatMap(arr, mapper));

Tests

Simply clone the repo, npm install, and run npm test

weaksetreact-hooksfullwidthcore-jsprotocol-bufferskeysefficientmergesetImmediateJSONObservablesnpmwrapWebSocketstextstyled-componentsurlsearchtypesafeUnderscorecolourfast-deep-copyhashexequeueMicrotaskjestdeepcopyregular expressionstermwalktypefigletfind-uppromiseremovekeyReactiveXpackagesanimationrmstylecloudsearchstreamescapeObservableoffsetqueryCSSStyleDeclarationES5picomatchmatchAllworkspace:*corenodehasOwnPropertyinvariantmimetypescompareprivatees7function.lengthdeepclonekarmasetPrototypeOfwafstdlibenvironmentlogbatchStreamsInt32ArrayansihardlinkschannelObject.keysstyleguidespeedrequestFloat32ArrayescodesexpresslocationfsArrayBuffer.prototype.slicetrimcloneschemeprefixTypedArraycolorsymlinkstapbddroutingFloat64Arraycss-in-jsgetPrototypeOfcjkECMAScript 2019bindtses-abstractjsdiffdomrouteglacierES2017ECMAScript 2020fetchtapeprotomochaproxyrdsdeterministichookforma11yfastifyspringopensreact-testing-libraryeditorutil.inspectagentrecursivesesnumberPushasyncterminalaccessorcliimmerserializerlimitedgroupBylookfunctiondefaultlengthArrayBuffer#slicereal-timejsdomcopyInt8ArrayajaxboundtypesdefinePropertyfast-clonevaluesratelimitserializedom-testing-libraryopenerWeakSetreducemaptyped arrayreadablebytewordwrappropertyindicatortoolkitkey valueloggingeventDispatcherapollolibphonenumberpackageonceinstalllazyforEachcoveragedefineString.prototype.trimsetterequalitytypescriptes2015autoprefixerjsonpathawaitgesturesdroptoolsReactiveExtensionspostcssURLSearchParamsprivate dataresolvesimple cachenegativeistanbulprocessgdprsymlinkdiffl10ntraverseframerwidthrangeerrormake dirinstallerproperties$.extendfull-widthrgbpopmotionbluebirdeast-asian-widthmkdirphoneRFC-6455MicrosoftchromeBigUint64ArrayECMAScript 6streamsfunctionalcloudtrailutiltelephoneextensionpluginArray.prototype.findLastgraphqlWeakMaplook-up_.extendArray.prototype.includessomerapidshelldebuggerTypeBoxfilereuseairbnbtouchString.prototype.matchAllrandomoptionestreethroatgetiamdeletemomentcloudwatchavaregexpiteratetoobjectES8file systemFunction.prototype.namefunctionsmimesidemkdirsECMAScript 3formattingisConcatSpreadableviewaccessibilityclass-validatoridlemovesymbolsReflect.getPrototypeOftoArraysameValueZerobyteLengthicuECMAScript 2021react-hook-formuninstallWebSocketinternalstartuuidconcatlinkmruvalidationreduxcheckrm -rfArraytypedarraysRxparseendpointschemagetintrinsicstylingcode pointsBigInt64Arraycollection.es6argumentscreateworkflowec2descriptionfindLastIndexconvertprototypedebugsetstringifyglobalreducerstatelesswordbreakjois3varspruneECMAScript 5xtermmime-dbUint16ArraywalkingjshintflatMapUint8Arrayiterationfixed-widthObject.fromEntriesbundling[[Prototype]]inputdeepwebsiteflattenassertsamazonredactcensordeep-cloneshamxdgIteratortypedfrompostcss-pluginfastcopypushformstaskelectronjson cachestarterreactcoercibleSymbol.toStringTagdependenciescallbackkey parrequireapiinspectArray.prototype.flatwritableecmascriptclientwaapiRxJSArray.prototype.containssortedcolumnsstructuredCloneconcurrencyhas-ownexpressionredirectpositiveUint32Arraychinesedirfast-copygroupargsES2018monorepoiteratoromitparsingentrieses-shimsstylesdescriptor__proto__directoryvalidatees2017getOwnPropertyDescriptorzerocolorscomputed-typestrimRightmkdirpform-validationfpsbundlerjasmine0es2018ES2015ES2016performantcollectiondotenvRegExp.prototype.flagsnodejsimportsafettyequalwaitloadbalancingtestmodulesbuffertrimLefthigher-orderparserhasautoscalingregularMapsettingsmakelockfileastargumentArray.prototype.findLastIndexlimitCSSconsoleES2019ender@@toStringTagfindupmatchsyntaxECMAScript 2015trimStartwhatwgserializationstoragegatewayoptimizerfindshebangnegative zerotddSymbolthreePromisecallbindnameimportexporterrorfastclonefast-deep-clonehelperscharactersObject.entriesemitloggerscheme-validationpipelistenerssequencedynamodbhooksstringifierjsonES7asciiES2020chromiumes8curlspinnerowncommandHyBiworkerJSON-SchemacryptotoStringTagposevestdateqsjsxrfc4122shimkinesisquerystringdeep-copy
2.2.10

2 days ago

2.1.9

4 days ago

2.1.10

3 days ago

2.1.8

5 days ago

2.1.7

6 days ago

2.1.6

7 days ago

2.1.5

8 days ago

2.1.4

9 days ago

2.0.4

10 days ago

1.0.4

11 days ago

1.0.3

12 days ago

1.0.2

13 days ago

1.0.1

14 days ago

1.0.0

15 days ago