1.0.3 • Published 12 days ago

@teamteanpm2024/dignissimos-tempore-veniam v1.0.3

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

@teamteanpm2024/dignissimos-tempore-veniam Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

Because Array.prototype.flat 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 @teamteanpm2024/dignissimos-tempore-veniam

Usage/Examples

var flat = require('@teamteanpm2024/dignissimos-tempore-veniam');
var assert = require('assert');

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

assert.deepEqual(flat(arr, 1), [1, 2, 3, [4]]);
var flat = require('@teamteanpm2024/dignissimos-tempore-veniam');
var assert = require('assert');
/* when Array#flat is not present */
delete Array.prototype.flat;
var shimmedFlat = flat.shim();

assert.equal(shimmedFlat, flat.getPolyfill());
assert.deepEqual(arr.flat(), flat(arr));
var flat = require('@teamteanpm2024/dignissimos-tempore-veniam');
var assert = require('assert');
/* when Array#flat is present */
var shimmedIncludes = flat.shim();

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

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

Tests

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

upeslintpluginreactUint32Arraysymlinkenvmomentlistenersargsbrowserreal-timearraysworkspace:*figlet[[Prototype]]fixed-widthcompilernativetraversemochasetImmediateapicharacteroptimizerpostcss-pluginUint16ArrayconfigmiddlewareUint8ClampedArrayes5removerm -rflintdescriptionPusheslint-pluginqueryreact-testing-libraryautoprefixerkarmachineseclassnameconnectgdprYAMLutilrgbbannerInt8Arrayinstallrequestreact-hook-formFloat64ArrayObject.entriespruneassignstringifygetwindowsinvariantbuffersgetterwordbreaklrues7rfc4122formatreadableio-tsparseESnextuuidvalidspecvisualstylepnpm9yamlutilitiesextrarobustArray.prototype.flattengesturesURLvariables in cssfast-copyquerystringclass-validatoravachromemkdirsansislotcensorstringES5dotenvTypeBoxfastifysidemkdirapolloES2020clientmobiletypedarrayvaluejsonrapidmakezeroparserbootstrap csssameValueZeroequalityimportairbnbcomputed-typessuperstructfunctionstylesheetObjectesloadingnodejscodescomparethroatgetoptperformantisregexfindweakmapsanitizearrayterminalinstallerspringObject.fromEntriescallboundsanitizationclassesthreeObject.assignsearchObject.definePropertyexitresolvexhrdomArrayBuffer#slicelookgetOwnPropertyDescriptordropproto_.extendxtermutilityperformanceArrayless mixinsvariablesreadpromiseWebSocketTypedArraycall-bindconsoleramdawalkingObject.getPrototypeOftypesafeduplexgraphqlpopmotionartObject.valuestouchsettingstrimLeftlimitedtslibwhatwgbundlingconcurrencywidthprogressposerminternal slotpostcssRFC-6455frameworkoutputcirculartrimEndimmerdescriptorsendercode pointsisConcatSpreadableenvironmentphonebyteLengthvestStyleSheeteslintconfigES2023flattenoptimistassertionshamtyped arraydebuggerbrowserlistdeep-copyprivateaccessorimmutabledataViewtddsignalspasswordcharacterstrimtaskestreecurriedlazypatchfetchminimalSymbol256keyscopyReactiveExtensionsassertsguidWeakMaplimites2017promisesscheme-validationcreatecryptostablelook-updataviewomitECMAScript 2018eventsnpmtranspileserializationcurlreuseconstformmixinsnameses8json-schemaspeedreadablestreamindicatorfastclonewrapprettysetmake dirargumentquotesymlinkshasOwnpolyfillmkdirpprotocol-buffersprotobufxssincludespoint-freeUint8Arrayratereducersettercall-boundvieweast-asian-widthpackage.jsonsignalString.prototype.matchAllObject.keysdom-testing-libraryCSSStyleDeclarationratelimithttpsdayjschromiumstyleswarningsyntaxerroroncepackage managertelephoneoperating-systembluebirdstreames2018offsetpluginString.prototype.trimurlshelltacitmimeautha11yhookformwebjson-schema-validatormime-dbjapanese3dbundlerfile systemcolumntestertoolkitbinddeep-clonetimesetPrototypeOfbddlessassertdeepcloneprocesswaitpyyamlfastdirectorymonorepobrowserslistauthenticationWeakSetchaipipeextensionreact animationwatchingnopefunctionsajvcheckMicrosoftargvwalkslicesortedstdlibsomesymbolscoercibledependency managermergereact posefindLastbufferirqtoobjectefficientcontainseventEmitterreduxes-abstractcollectionconsumeconfigurabledeleteRxJShardlinksinspectfilterpersistentreducestarterasyncECMAScript 2020interruptsregular expressionsflatMapformattingthrottle6to5dragRegExp#flagsemitObservablestextInt32Arrayi18nrangeerrortestingvalidatetypedarraysES2015hasES2017ECMAScript 2017trimStart$.extendfast-deep-copycallbindcolorsprefixcss nestingrecursivebootstrap lessobjectdirshebangenumerablenested cssECMAScript 2015fullwidthnegative zeroform-validationes-shimsjoiredux-toolkitstructuredCloneECMAScript 6ECMAScript 2023findupecmascriptpropobjhttppreserve-symlinksprivate datapropertytypeddebugunicodeJSON-SchemaECMAScript 2021ReactiveXinferenceserializegetintrinsicloggertoSorted@@toStringTagpackagesIteratorcss lesses-shim APIjsdomjstrimRightHyBieverytypescripteventDispatcheridlebusyfilesigintextendcoresuperagenthelpersless cssjsonpathloggingmovedeterministicttyarktypeanimationpicomatchES2019ajaxfunctionaljsonschemaclassnamesasciiMapkoreangenericscssarraybufferawesomesauceiteratorAsyncIteratorstreamsworkersigtermECMAScript 3ponyfillclonebyteOffsetsequenceECMAScript 2022rm -frpathJSONtypeerrorvalidationsortqsstylingconcatMapentriesrandomstreams2lastbabel-coreparentslibphonenumbertypetypanionequalhooksfolderReflect.getPrototypeOfgetPrototypeOfemojiES6mruArray.prototype.flatSymbol.toStringTaglinewrapserializerwget.envObject.isgroupfast-deep-cloneTypeScriptbcryptESmimetypeslanguagesharedpackagehandlers
1.0.2

13 days ago

1.0.3

12 days ago

1.0.1

14 days ago

1.0.0

15 days ago