1.0.0 • Published 16 days ago

@rabiepenpm/quidem-accusantium-maiores v1.0.0

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

@rabiepenpm/quidem-accusantium-maiores Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2015 spec-compliant Array.prototype.keys 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.keys depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.

Example

var keys = require('@rabiepenpm/quidem-accusantium-maiores');
var assert = require('assert');
var iterate = require('iterate-iterator');

assert.deepEqual(iterate(keys([1, 2, 3])), [0, 1, 2]);
assert.deepEqual(iterate(keys([1, 0, 1])), [0, 1, 2]);
assert.deepEqual(iterate(keys([NaN])), [0]);
assert.deepEqual(iterate(keys([1,,3])), [0, 1, 2]);
var keys = require('@rabiepenpm/quidem-accusantium-maiores');
var assert = require('assert');
/* when Array#keys is not present */
delete Array.prototype.keys;
var shimmedMap = keys.shim();
assert.deepEqual(shimmedMap, keys.getPolyfill());
assert.deepEqual(iterate([1, 2, 3].keys()), [0, 1, 2]);
assert.deepEqual(iterate([1, 0, 1].keys()), [0, 1, 2]);
assert.deepEqual(iterate([NaN].keys()), [0]);
assert.deepEqual(iterate([1,,3].keys()), [0, 1, 2]);
var keys = require('@rabiepenpm/quidem-accusantium-maiores');
var assert = require('assert');
/* when Array#keys is present */
var shimmedMap = keys.shim();
assert.equal(shimmedMap, Array.prototype.keys);
assert.deepEqual(iterate([1, 2, 3].keys()), [0, 1, 2]);

Tests

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

css-in-jsargvcolorguidCSSStyleDeclarationaccessibilitythroatopeninterruptsassertionlengthmime-dbjson-schema-validationregexrgbES2023datastructurekeystranspileawaitgdprcommanderargumentwhichtrimEndInt16ArraypropTypeBoxbddstdlibenumerabletypetoStringTagAsyncIteratorwalking[[Prototype]]fastifygettercharacterseslintclassnamepipepureMicrosoftcompilerECMAScript 3apiObject.keyses2015robuststyling3dchaicircularphonecss nestingrequestwritablepyyamlbabel-coreawesomesaucecolourshelldatextermstylesairbnbRegExp#flagsjson-schemaless compilerbusyequalityURLeventEmitteres8file systemconfigurablevariablespnpm9Object.fromEntrieslinkpathhasOwn0reduxexitlimittestschemeextendTypeScriptvalidatorfindLastIndexsigtermes7json-schema-validatorspinnerspostcssl10nECMAScript 2023popmotionECMAScript 5isConcatSpreadableonceBigUint64Arrayregular expressionsencryptionwatchString.prototype.matchAllArrayBuffer.prototype.slicefunctionslinuxviewwhatwgpromisesrmdircreateelectrontypesmobilefast-copymimeshimspeedtslibbrowserlistweaksetnested cssprogresstestingmoduleES2019Int8ArrayjestterminalWebSocketssuperagentansi256east-asian-widthstringisdebuggerObject.assignlibphonenumberpreserve-symlinksprotoindicatorvaluesserializetoolsPushcoercibleredactdeep-copyreact-hook-formRFC-6455debugMapdatajsonmatchmrutoolkitcjkstatelessasyncjwtstreamspushformspatchtermfunctionArrayBuffer#slicesearchgraphqlintrinsickoreanremovemkdirpfind-upshebangless cssreact pose@@toStringTagletmkdiraccessorYAMLBigInt64Arraymodulesloadingomitexit-codeoutputpreprocessorchromepicomatchJSON-Schemabufferflattencall-bindjasminedropes-shim APIqsdescriptionconcatgetOwnPropertyDescriptormiddlewareruntimevalidateutiltacitReactiveXdataviewFloat32ArrayES7mergetextECMAScript 2020springUint16ArrayECMAScript 2022efficientdependency managersymbolexeclooksameValueZerocryptoauthpluginglobStreamsresolveoptionpropertiestrimLeftfindmkdirs.envpoint-freeIteratorextrareact-hooksES2017iteratorparentObject.entrieswalkmacoslintfilterfast-deep-copytypanionhandlersjsArray.prototype.flatschemahttpasttypesafegetintrinsicarktypelimitedsortedsetwatchingreadgenericsthrottleECMAScript 2015configArrayBuffercommandqueuehastesteres5validationdeterministicbundlingxhrtc39Object.getPrototypeOfforEachdeepWeakMapdiffArray.prototype.containstypedarraysequalstreams2hardlinkslisteners$.extendmomentES2022bundlercore-jsWeakSethashtoSortederror-handlinglessspececmascriptcommand-lineprotobufless.jsRegExp.prototype.flagsreact animationrm -frES5constautoprefixerES6makeregular expressionsideArray.prototype.findLastIndexenvironmenttypeofcallsyntaxObject.definePropertytyped arrayvaluenpmtimetostringtagprototypeajvxssclonemapserializationInt32Arrayjavascriptuser-streamsweakmapfindLastposescheme-validationdirqueueMicrotaskparentsrapidstreamObservableratelimitcolumn6to5workspace:*sanitizationsetPrototypeOfECMAScript 2017ES2021fast-deep-clonees2018nativecomputed-typeslesscsspackagegroupBymove__proto__Uint8ClampedArrayenvpersistentbindconnectiterationtypescriptcompareprivatewindowsio-tseslint-pluginSetinputhooksprotocol-buffersformatrequirees6dayjsinstalleroffsetendera11yquerydragpasswordtoobjectstarterbootstrap lessramda
1.0.0

16 days ago