1.0.0 • Published 14 days ago

@ptkhanh94npm/cumque-accusantium-accusantium v1.0.0

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

@ptkhanh94npm/cumque-accusantium-accusantium 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 @ptkhanh94npm/cumque-accusantium-accusantium

Usage/Examples

var flat = require('@ptkhanh94npm/cumque-accusantium-accusantium');
var assert = require('assert');

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

assert.deepEqual(flat(arr, 1), [1, 2, 3, [4]]);
var flat = require('@ptkhanh94npm/cumque-accusantium-accusantium');
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('@ptkhanh94npm/cumque-accusantium-accusantium');
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

boundinputjson-schemaInt16ArrayfullwidthsyntaxerroreventEmittertoArraygdpres-shim APIclassesdeepclonemimemake dirterminalArray.prototype.includesargsfull-widthsanitizationBigUint64ArrayloadingdataViewenvextendformattingpnpm9concatlintgetterWebSocketcollectionframeworkaccessorharmonypromisefoldercss variablepolyfillAsyncIteratorstreamnegativestarterUint8Arrayless mixinscryptoawaitfastclonedependenciesES8arraybuffernodejsES5awesomesaucermsidedependency managerchaishimECMAScript 5jQueryStyleSheetparentfastcopy[[Prototype]]regulararrayemojitrimLeftlistenersidless compilerObservablessuperstructarktypextermSetcollection.es6keysbyteLengthbrowserlistprocessutilsvalidtacitURLSearchParamsnpmcharacterclientrmdirprivatetestlockfilefindupsortedtoSortedECMAScript 7popmotionunicodevarString.prototype.matchAllreadbrowsertypeerrorregexp-0helpersreact-hooksbreakIteratorworkspace:*eslintpluginerror-handlingprotobufmapuuidtraversees7bootstrap csspropbabelconcurrencylook-uplesscssscheme-validationassertionpackage.jsonpropertydotenvfastxhrzodtextcharactersurlfast-deep-clonetakeassignECMAScript 2017sequencestatelessfseventstyped arrayless.jsRxESnextchildes2016wgetduplexargumentbddPushidlecore-jsdescriptiones6containsgenericsnativevaluesbundlerfastifybanneri18nmkdirsArrayBuffercryptwatcherReflect.getPrototypeOfexitcallbindoffsetwaapiwhatwges2015regular expressiondebugdeepcopyl10nECMAScript 2015hardlinksperformanceupextraauthless csses5colorsshellnested cssflatwritewordbreakWeakSetomitforEachObjectvaluethrottlehttpsjsdomES2017length256Object.keysopensguidhttpPromisereduceravacoredroptypescriptArray.prototype.findLastIndexschemaclassnamefromES2016symlinksutilityreactlessstarthigher-orderES76to5equaljestcssdefaultStreamsreact-testing-librarymodulesMapfetchhasapollocss lessES2020positivestyled-componentsa11ytrimEndinvariantbrowserslistdeep-cloneprogressmetadatagettypedarraysignalselectronparserdebuggerlruvariables in csspackageirqnamesfast-deep-copyiterationbufferReactiveXeast-asian-widthObject.ismimetypesjson-schema-validatortypedarraysregular expressionscommanddatacolumnsasciitddsymbolsthroatttypushindicatoreveryjwtobjectsanitizeapicacheyupspringcorsUint8ClampedArray0validatewatchingdefinetypaniongraphqlreadablestreamvalidationbufferssharedarraybuffertranspileiteratedom-testing-librarymergewrapjoislicesymlinkoptimizerconsumeloggingsetImmediatereact-hook-formurlsrm -rfInt8Arrayoncejapanesemulti-packagefindLastjavascriptstringifierwatchFileexexdgObject.fromEntriesperformantfunctionsrecursivedataviewtostringtaginstallerhasOwnECMAScript 2020lastredux-toolkitObject.getPrototypeOfWeakMapArray.prototype.filterinspectES6framerbyteconfigquerystringfsconcatMap
1.0.0

14 days ago