1.0.0 • Published 1 year ago

@saoviettest/magnam-deserunt-doloremque-ipsa v1.0.0

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

@saoviettest/magnam-deserunt-doloremque-ipsa 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 @saoviettest/magnam-deserunt-doloremque-ipsa

Usage/Examples

var flatMap = require('@saoviettest/magnam-deserunt-doloremque-ipsa');
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('@saoviettest/magnam-deserunt-doloremque-ipsa');
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('@saoviettest/magnam-deserunt-doloremque-ipsa');
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

react posewafansicall-bindemojisnsvpcframeworkWebSocketpropertygetpatchbytepushECMAScript 2016commanderuninstalldebuggertypeerrorcloudtrailwgetthrottleiespawneventsArraypersistentpackagemapfast-deep-copyappformatslotgroupstreamqueryeventEmitterlocationcolumnses8reacthookformFloat32Arrayprivatetoobjectrmdirbeanstalkconsumesearchcryptoeslintpluginfile systemparentslrutextpiperoutingserializationpicomatchmkdircircularinspectdiffstdlibutilitiesmodulespropdefinePropertycode pointscallbindperformantTypeBoxflagefficientMapfind-uprangeerrordeleteio-tsbuffersmime-dbcloudwatchwaitparentdatastructureredactObjectnumberflatMapshelljshintloggerasserttostringtagclass-validatorrm -rfdataviewsqsfpssetImmediatereducelinkES5debugsyntaxerror3damazontoStringTagdeepclonecacheintrinsicsetterECMAScript 2021cloudsearchECMAScript 2018mochaiteratewritei18nprotobufmapreducecompilersequenceform-validationinpackagesoptimistruntimecharactersforEachposepromisesjsonpathenvironmentsfunctionalequalbrowserlistbluebirdtraversewordbreakgraphqlglacierjsexeglobalUint16Arraymrucomputed-typesES2022yupebsdeepString.prototype.matchAllmomentchinesejasmineexecwidthcollection.es6expressionisInt16Arraypackage.jsonprotocol-buffersreduxArray.prototype.findLastIndexmergeutilitypluginhasOwnPropertyhas-ownthroatparseeditorsharedarraybuffersetPrototypeOfstructuredCloneiamstringextensionecmascriptlintsymlinktypesafecss-in-jspruneenves-shimsrgbES2021Object.entrieses5toolsloadingvisualqscontainsdescriptorscollectionRxsettingssymlinkssafeprototypematchCSSBigInt64Arrayiteratortouchcore-jsremovequeueindicatorwebgdprautoprefixerAsyncIteratorenvironmentECMAScript 6callloadbalancingresolveshebangnopeasynclaunchs3ajvcallbackuuid-0hooksisConcatSpreadablebundlingfindupdescriptionES2016toolkittypesphonetypedarraysslicepromisestoragegatewaycloudfrontcolorsjsdomjsonsyntaxreducercolumnapiprotodatapropertiestoArrayguidmake dirrdschaistarterargses2017ownfullanimationdataViewhardlinksrapidxdg-opengroupByECMAScript 2015nodejsawsArray.prototype.findLastURLSearchParamsstyleswritableaccessorclientgetintrinsicbatchredux-toolkitscheme-validationtrimLeftjQueryArray.prototype.containssuperstructtypedfixed-widthomitES2023toSortedstringifyes2016importexportprocesssymbolxtermwarningMicrosoftl10nes2018parserec2argumentscodesconcurrencyupesdragutil.inspectfschromepostcss-pluginxhrfast-deep-clonelazyinputhashes6route53telephonefindLastvalueinvariantsorteddynamodbsomesymbolsrecursivefastclonemkdirpcall-boundquerystringcolourwordwrapparsingerrorponyfilles7full-widthObject.valuesweaksetUint32Arrayrouteexecutablecommand-linetslibkoreanchildObject.getPrototypeOfoptimizerpolyfillaccessibilitytypescriptstringifierformsoncefilterelasticacheReactiveXfetchworkerReactiveExtensionsregexpcensormimefolderflagsES7apollofunctionsoutputcsslastajaxTypedArrayES2019mkdirsrequireopensbindrobustdescriptorcmdsideformattingpreserve-symlinkszodStyleSheetSetArrayBuffercreateemrmonorepostablebusydirectoryproxygesturesenderprefixconvertmoveagenttddflattenvarssameValueZerofigletperformanceassertionWeakSetfast-copyPromiseworkflowfastArrayBuffer.prototype.slice@@toStringTagfindECMAScript 2017_.extendtrimbuffertc39threecharsettakereuseincludescloudformationendpointECMAScript 7dependenciesregularspringentries[[Prototype]]react animationteststartbreakRegExp.prototype.flagsurlvestStreamsReflect.getPrototypeOfdoma11yvariablesopenprogresstermfilemakeoffsetfindLastIndexObservablesArray.prototype.flattenwhichcoercibleprettywalktypedarrayeast-asian-widthhttpsiterationstatelessduplexStreamtestingkarmaautoscalingchromiumdeep-copylibphonenumberglobrequesttaskchannelJSON-SchemacharactervalidinternalwrapECMAScript 2020languageasciitapdatearraybufferregular expressionequalitypostcssidleSymbolextrastreams2validateimmerstreamsreadablesesargvratelimitArray.prototype.includesbddlogsetloggingmobilespeedString.prototype.trimcompareidentifiersqueueMicrotaskmatchesyamlartbyteOffsetES6es-abstractpathcommandreact-hook-formdefineutilargumentspinnercoreschemeeslintnativeredirectcopyrmURLshrinkwrapES2015idtypanionspinnersjsdiffregular expressionsconfigPushIteratorTypeScriptviewObject.fromEntriesInt32Arraytypebanneremithttpdom-testing-libraryweakmapwhatwglookiconvsimpledbtimeswfbrowser256concatWebSocketseventDispatcherdirprivate datalinewrapnodeawaitnegativewebsitereal-timebundlertyped arrayjestgetOwnPropertyDescriptorestreepopmotionRxJSlengthcallbound__proto__ES3walkingfastifystylingArray.prototype.flatMapmetadataUnderscoreinstallObject.definePropertystyled-componentszeroarktypepackage manageres2015jsxUint8ArrayconcatMapBigUint64ArrayenumerableRegExp#flagsESsharedECMAScript 2022astcurlFunction.prototype.nameelectronboundgetoptxdglimittrimRightfromreact-hooksECMAScript 2019argparseimportregexfunction.lengthnamesstyleguideobjectcjkelbformrm -frterminalmimetypesawesomesaucedeterministicjapanesepyyamlESnextlistenerseslint-plugingenericsrfc4122airbnburlsunicoderatevalidationsuperagentshamjavascriptflatwaapirandomarrayHyBifunctiones-shim APIObject.isnameimmutableinstallernpmdeepcopyYAMLtesterCSSStyleDeclarationES2020spechigher-orderbrowserslisticucolorfullwidthassertsframerevery$.extendcheckglobalsgetterArray.prototype.filterlook-upquotehelpersSymbol.toStringTagES2018configurablebyteLength.envcloneRFC-6455minimalArrayBuffer#sliceECMAScript 3ES8espreetsdefaultttysortkeysdeep-clonegetPrototypeOflockfileFloat64ArrayObject.assignmodulearraysJSONpositiveObservableavaworkspace:*dependency manager
1.0.0

1 year ago