Licence
MIT
Version
1.0.0
Deps
9
Size
14 kB
Vulns
0
Weekly
0
@odczynflnpm/voluptatibus-blanditiis-non 
An ES5 spec-compliant Array.prototype.map 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.map depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.
Example
var map = require('@odczynflnpm/voluptatibus-blanditiis-non');
var assert = require('assert');
assert.deepEqual(map([1, 1, 1], function (x) { return x + 1; }), [2, 2, 2]);
assert.deepEqual(map([1, 0, 1], function (x) { return x + 1; }), [2, 1, 2]);
var map = require('@odczynflnpm/voluptatibus-blanditiis-non');
var assert = require('assert');
/* when Array#map is not present */
delete Array.prototype.map;
var shimmedMap = map.shim();
assert.equal(shimmedMap, map.getPolyfill());
var arr = [1, 2, 3];
var add4 = function (x) { return x + 4; };
assert.deepEqual(arr.map(add4), map(arr, add4));
var map = require('@odczynflnpm/voluptatibus-blanditiis-non');
var assert = require('assert');
/* when Array#map is present */
var shimmedMap = map.shim();
assert.equal(shimmedMap, Array.prototype.map);
assert.deepEqual(arr.map(add4), map(arr, add4));
Tests
Simply clone the repo, npm install, and run npm test
Keywords
metadatacommandmakeObservablespackage managermapkarmafast-deep-cloneminimalbabeldirectorydelete__proto__css-in-jsassignObject.definePropertymkdirsfetchES8safeclassesfile systemhasOwntypeofJSONclassnamematchesfastcopyfilterexpressiteratespinnertypedarraysECMAScript 2022look-upthroatbcryptECMAScript 3es2018error-handlingES2015regular expressionsbusyweakmaptacitTypeScripttypescollectiontrimEndserializees2017fullwidthwebfigletsetPrototypeOfreact animationlazyObject.isschemajson-schema-validationloggingposeArray.prototype.containscorsjsdomshamglobSymbol.toStringTagjsxchrometakeinvariantsignalsdom-testing-librarypyyamloutputpnpm9jsonInt32Arrayconsolecall-boundajvhooksarraysBigInt64Arraydebuggerargsdependency managertty[[Prototype]]emojioffsetdatapositiveobjpruneECMAScript 2015statelessgetbyteOffsetArrayBuffer.prototype.slicefastifyinternal slotredux-toolkitbytehardlinksstyled-componentsStreamshascomputed-typescss lessdraghttprm -rffslockfilereactvaluelogsignalObject.assignECMAScript 5descriptorscss nestingArray.prototype.flattouchqueryES2018installerreusehandlerstypedarrayuninstallsorttoArrayopensliceenvlistenerszerosymbolfpsanitizationgenericslaunchObject.getPrototypeOfjasmineECMAScript 6readablephonebootstrap lesses-shim APIpicomatchfileArray.prototype.findLastarraybuffertypesafeinterruptscallfromArray.prototype.includesplugindomyupargumentxdg-openxhrstringifierArray.prototype.flattennativees2015guidtoolkitframeworkpushiterationl10n3dArraydeterministictoobjectprivateajaxpathdeepclonedirexewaapisequencecodestypescriptECMAScript 2020speedautoprefixerarrayjQuerysearchurlArrayBuffer#sliceeditorargvtrimRightcontainsestreeRegExp#flagslanguageflatMaptoSortedprivate dataes8Observableinspectdescriptionbatchtyped arrayWeakMaparktypePromiseparsebundlingfast-cloneextendclass-validatorstyleguideoncegetOwnPropertyDescriptoremitString.prototype.trimmacosreal-timeefficientcallbindframerWeakSetFloat64Arrayopenersidecensorenumerablenegative zerolooklruregexwhatwgrm -frshrinkwrapPushjsdiffprocessRFC-6455jsonschemabootstrap csses-shimsassertrmpreserve-symlinksmkdirtesterequalitybufferflagsprototypewidthfind-upharmonyfoldercall-bindfast-deep-copytranspilerfantasy-landlengthwatchFilewordwrapCSSStyleDeclarationfastimportES2020quotees-abstractwalktranspilecoloreslintpluginpropertykeygradients csscreateECMAScript 2019pureindicatorbuffersrapidargparsepoint-freejscopytestingtextremovepackagecheckreact-hooksgetterdependenciesmonorepoBigUint64ArraygroupByimmutablesuperagentredactponyfillsymlinknpmpromisesaccessorvisualmruupwordbreakcliramdaregular expressionflattenuser-streamsconsumeentriesReactiveXextensionfseventspropertiescjkstarterasciigestures6to5symlinksforEachserializationStreamES2022findLastdifffunctionsTypedArrayUint8Arrayexpressionmergea11ystylingencryptionhookformunicodecoloursettingsexecutabletoStringTagStyleSheetESnextcollection.es6moduleshebangmovedefaultsymbolsbabel-corejson-schema-validatorcurriedescapeidleargumentsgradients css3matchapolloincludesspecbreakvalidatorcallboundlesscsstrimLeftauthgroup
