1.0.1 • Published 1 year ago

@libgitname/tempore-enim-non v1.0.1

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

@libgitname/tempore-enim-non 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 @libgitname/tempore-enim-non

Usage/Examples

var findLastIndex = require('@libgitname/tempore-enim-non');
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('@libgitname/tempore-enim-non');
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('@libgitname/tempore-enim-non');
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

toobjectvisualpipeTypeBoxsyntaxstreamsisConcatSpreadablegetPrototypeOfflatinternalutil.inspectpreserve-symlinkses5libphonenumbermomentYAMLfindloggergroupByonceflatMapminimalprotohasOwnregular expressionguidpromiseTypeScriptwalkhttpsless.jsuuidairbnbwatchingasciivariablesgetoptcensorwgetArray.prototype.findLastStreamsbrowserslistcore-jsECMAScript 6zeropicomatchhardlinksflagshamstringifyserializationlinkjsonschemaeslinttc39callpathbannersorteverycolorsextraargparsejsonMapObservablesES2015toolsweblanguageirqentriestermStreampasswordterminalhooksnegative zerowatchuser-streamsautoprefixerforEachjoiclonediffES5descriptorsObject.fromEntriesfast-deep-cloneprocessaccessorcallboundreact poseTypedArrayprivate datatyped arrayless cssincludesphoneObject.definePropertychaiqueryoptimistajvmetadatareact-testing-libraryFunction.prototype.namemapresolvedragbyteOffsetrm -rftapreactencryptionserializervarbreakwalkingquerystringECMAScript 2022es6schemeURLSearchParamsECMAScript 2019fastschemamatchAlltrimRightjeststylingpreprocessorwatcherdomcircularArray.prototype.flatMapauthes2015linuxECMAScript 2023JSON-SchemajsdifffunctionsSymboldatavieweventDispatcherruntimemakeHyBifast-cloneargvprefixfetchutilitiescode pointsES2018performanceregexloadingdeleteconcurrencyArray.prototype.flatURLjson-schemaarktypeparentsidle-0traverseconnectES2021gradients csspnpm9artconstjwtremoveRxJSpackage.jsonmatchesfastclonenpmtoStringTagfigletECMAScript 2015mkdirsrmdirspinnersfindLastIndexessharedauthenticationdescription3dArraycoercibleArray.prototype.findLastIndexcallbackECMAScript 2020valueclassnameawaitsymbolses-shimsinstalldeepcopyRegExp.prototype.flagsutilitysideendermatchenvironmenttesterArrayBuffer.prototype.slicecss-in-jsless compilerwaapiescapextermposepluginpackageprotobuftestthroatqueueObject.keysconcatMapcommanderassignupslicegetintrinsicyupMicrosoftArray.prototype.includestestingviewdirzodbabelparentvalidinterruptswhichtypesortedconsoleES2017ArrayBuffer#sliceconfigFloat64ArraylimitUint8Arrayreact-hook-formqueueMicrotaskerrorwindowsuninstallerror-handlingES2020ECMAScript 2016trimLeftansistreamloggingtypeerrorflattenpersistentimportfastifyfilecompile lessreuseoperating-systemeslintpluginnegativeasserthigher-orderpackagesvestmrucryptoreadablees-shim APIinternal slotES2023EScryptwhatwgwriteutilfullwidthexecStyleSheetfull-widtheast-asian-widthbyteregular expressionsArrayBufferArray.prototype.flattentapereact animationlasttscomputed-typessafelistenerstoArrayES2022filterio-tstasktrimEndCSSpropertiessetnativepopmotionharmonycommandperformantstringifierwarningWebSocketmulti-packagermserializesetImmediatetimearraylimitedreducerconcatiechinesedayjs
1.0.1

1 year ago

1.0.0

1 year ago