1.0.0 • Published 12 days ago

@wemnyelezxnpm/pariatur-quam-expedita v1.0.0

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

@wemnyelezxnpm/pariatur-quam-expedita Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.findLastIndex 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.findLastIndex 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 @wemnyelezxnpm/pariatur-quam-expedita

Usage/Examples

var findLastIndex = require('@wemnyelezxnpm/pariatur-quam-expedita');
var assert = require('assert');

var arr = [1, [2], [], 3, [[4]]];
var isNumber = function (x) { return typeof x === 'number' };

assert.deepEqual(findLastIndex(arr, isNumber), 3);
var findLastIndex = require('@wemnyelezxnpm/pariatur-quam-expedita');
var assert = require('assert');
/* when Array#findLastIndex is not present */
delete Array.prototype.findLastIndex;
var shimmed = findLastIndex.shim();

assert.equal(shimmed, findLastIndex.getPolyfill());
assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));
var findLastIndex = require('@wemnyelezxnpm/pariatur-quam-expedita');
var assert = require('assert');
/* when Array#findLastIndex is present */
var shimmed = findLastIndex.shim();

assert.equal(shimmed, Array.prototype.findLastIndex);
assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));

Tests

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

watchlimitenumerablecallES5mime-dbObject.getPrototypeOfawaitreducediffpoint-freetostringtagtypedtoStringTagES2022lruecmascriptECMAScript 2019httpsmovefast-deep-copydir__proto__speedjsonschemaiterateextraidless.jsPromisecolumnschannelappproplessbootstrap lessclassnamefile systempruneprotobufES2021curriedrapidboundsymbolexitnumberessymbolstypereact animationcommandprototypebabel-coredropYAMLeventDispatchersymlinkclirm -rfECMAScript 5es6buffersReactiveExtensionsassigndirectoryes5assertshamtypescriptoutputmakevalidatemkdirtelephoneiterationqueueMicrotaskES2017poseio-tsfindpluginjoibytepostcssTypeBoxtrimLeftsetPrototypeOftraverseinferencegradients csslengthcolourfastclonetypedarrayerrorinstallerInt32ArrayinstallstatusgraphqlECMAScript 2020websiteStreamsanimationhookseast-asian-widtharraybuffercollection.es6syntaxerrordeep-copyECMAScript 2016languagefixed-widthxtermtacitprivatepersistentbyteOffsetslotlinuxdependenciesObservablelookvaluelimitedhookformyamlconnectperformantargsfastcopyttymomentcallbackstreamsES2018cryptpropertyuninstallmimetypestrimRightbrowserECMAScript 3validationjQuerytoSortedreal-timewriteequalityconfiges-shim APIonceviewreadCSS256package manageromitwidthtrimEndstylefsclassnamestyped arraypasswordartdependency managerpreprocessorapithreecopyframerSymbolESnextnamestoobjectreact-hook-formeditorbufferautoprefixercloneextensioncall-boundxhrurlsyntaxeslintpluginArray.prototype.flattenmatcharktypeaccessorthroatless mixinsObject.ismodulemodulesenvironmentfast-deep-clonewebcollectionECMAScript 2015writableeventEmittereslintconfigArrayBuffer#slicemergeInt8ArraySettextmobileObject.definePropertyclass-validatornativefindLastIndexworkspace:*WeakSetcssquerydeepcopydataViewwatchFilexdg-opensearches2016ES7utilitiesintrinsicstablehashjson-schema-validationparsexssvariables in cssObject.valuesspinneroptimizercontainspyyamltranspileinterruptshandlersfindupES3prefixvarrm -frrmdirflattenlibphonenumbervisualprotoECMAScript 2017packagejestfullframeworkremovestructuredCloneindicatorcircularECMAScript 7phonel10nmatchAllECMAScript 6corstimexdgTypedArrayregex$.extendwalkjsonpathexeArraymacoskeydeterministicbrowserlistcall-bindshimjavascriptcurlObject.entriesexit-codearraysspinnersInt16Arraypreserve-symlinks.env3dargumentsbindJSONsuperstructsharedarraybufferwhichdomwordwrapasyncajaxobjectrangeerroropensetjwtESimmutablebannerObservablesescapepropertiesfastless cssstylesheetthrottlebusyfantasy-landshrinkwraptoolkitmruspawnsetterhasfullwidthregular expressionRegExp#flagscharactersformatsequencermconsolestringifysettingsglobrequeststreams2Objectformattingargvbabelbreakconcurrencyes2018chaiconcates7nopeeventsopensECMAScript 2022dayjsargumentdefaultestreepromisesECMAScript 2018springWeakMapramdacallboundasciifromsignalregular expressionskeysauthenticationAsyncIteratortestergetoptsliceprotocol-buffersirqsideformString.prototype.trimhttpbundlercompilererror-handlingbluebirdnested cssopenerlastArray.prototype.flatMapdragratelimitjsdomeslintconsumeregexpUint8Arrayuuidtap_.extendECMAScript 2021childfigletsignalscss variabletrimregularwalkinggettertypeerrorstreamwaitreact-testing-libraryFloat64ArraysortedmochasortflagsArray.prototype.flatserializationfolderformsnodejsObject.fromEntriessafeletsymlinksclientIteratorBigUint64ArrayrandomargparselistenersweakmapequalpipetoolsUint16ArraywgetES2019cachepicomatchunicodevalidatorArray.prototype.findLastjsonqueueimportReactiveXhelpersmapreadablepositiveArray.prototype.includesquotequerystringparserwhatwgmkdirses2015chromiumcss lessshellfindLastdatastructurespecutilityawesomesaucestringECMAScript 2023sameValueZeroArray.prototype.findLastIndexcallbind[[Prototype]]CSSStyleDeclarationcommand-linepromisecompareemitless compilerPushnegative zerotypanionFloat32ArraynegativeWebSocketcss nestinggradients css3colorclassescode pointssharedHyBiidleJSON-SchemaexpressionbrowserslistString.prototype.matchAllTypeScriptinvariantfilecss-in-jsrequireisnpmgetOwnPropertyDescriptordefinevalidtouchlogObject.keysutilieresolveenderaccessibilityinternaldom-testing-librarymatchesreducerduplexisConcatSpreadableavargbmonorepoassertscolorsES2015RxJSkoreanfilterflatbcryptES2020UnderscorekarmaURLurlsassertiontypesafestyled-componentsfull-widthmixinsyupstartpurezerostatelessconfigurableperformanceterminalbyteLengthgesturesdebugstartereslint-plugincodesbootstrap cssdataviewcompile lesslesscssexecutablecoercibleutil.inspecttestingapolloprogress@@toStringTagfpES8a11ydeletesomeredactpopmotionwarningES2016ansigenericsmkdirpmake dircolumnES6WebSocketsgetintrinsicchromeArrayBuffertestemojicreatevaluescensorstylesprettybdd-0sigtermrfc4122fastifyloggereveryMaptslibextendRegExp.prototype.flagspnpm9middlewaresigint
1.0.0

12 days ago