1.0.0 • Published 21 days ago

@devtea2025/labore-necessitatibus-cum-temporibus v1.0.0

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

@devtea2025/labore-necessitatibus-cum-temporibus 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 @devtea2025/labore-necessitatibus-cum-temporibus

Usage/Examples

var findLastIndex = require('@devtea2025/labore-necessitatibus-cum-temporibus');
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('@devtea2025/labore-necessitatibus-cum-temporibus');
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('@devtea2025/labore-necessitatibus-cum-temporibus');
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

RxReactiveXSymbolshellObject.definePropertyreduxmobilestreamsglacierunicodegetoptAsyncIteratorinvariantdebuggerhookses2017Array.prototype.containstaskcommandercore-jsfastcopybyteLengthwgetsortedregexpsyntaxerrorcolorseslintsymlinkavacodesconcatMapes-shim APIajvsymbolsmulti-packagescheme-validationreadablestreamsigtermArray.prototype.flatconsolefunctionsrm -rfserializevalidationfunctionalWeakSetnodeperformancesymlinksRFC-6455querystringnegativekeyglobalsstoragegatewayfluxmochaebsfolderformcss lessObject.keystrimwalkingBigInt64ArraysignalsdataviewdotenvPromiseeventsworkspace:*[[Prototype]]checkairbnbjavascripthttpsexitweaksetprettysome__proto__wordwrapxdg-openrmdirstartexehas-ownsetPrototypeOfpredictableURLregular expressionsdescriptorsserializerl10ninspectrequirespawnclassnamesharedarraybufferflagscssjsdiffArrayBuffer.prototype.sliceprefixgradients css3passwordFloat64ArraymimetypesdataViewnpmwritabletermES2016datezodcomparestablepatchtoArraynamehasOwnPropertypackagesgdprcurlieHyBiTypedArrayredux-toolkitpostcsselectronUint16ArrayObject.assignargvremoverateponyfillflatMapdefaultpruneReactiveExtensionsreducerdebugdefinePropertyfetchform-validationautoscalingYAMLWebSocketsentriesbindmatchesreact-hooksarktypeassertionisConcatSpreadablesettypedarraysprototyperestfast-deep-copyregularpropertyapitestpreprocessorCSSStyleDeclarationmergees5flagasynclazyObject.getPrototypeOfchromexhrcloudtrailtrimEndguidStyleSheetrfc4122lengthtestingcall-bindoptimistworkerObject.issetImmediateswfCSShotastcallboundcharacterscolorfilterpackage managerpromiseseslintplugines6findLastIndexmodulesbrowserlisthandlerscoercibleappUnderscorefulllaunchtrimRightpostcss-pluginparsinggetPrototypeOfbannerfixed-widthjsdombundlingrmchromiumnodejslanguagecorsdefineec2.envUint8ArrayargparsestringifierirqsuperagentquerycallbackquotedomRxJSfigletenumerablecompilerzeroreact-testing-librarydeep-clonepackagemoduleexpresstimeintrinsicjasminereducejsonlistenerspackage.jsonxdgreplayasciijshintloggerconsumecensormovemapduplexmonorepovalidateiteratorarraysmkdirsweakmapsinatrafastclonehookformbytediffes2015kinesisesawaitclassnamesargsfast-copycharacterprocessstyled-componentsopentoolsyamlnested cssless cssgetOwnPropertyDescriptorreact-hook-formregextypedterminalstdlibopenshasfastifyvalidruntimeeast-asian-widthbufferslotshamspinnersparentsmakeFloat32ArrayyupArray.prototype.filterReflect.getPrototypeOffunctionhelperslooklook-uptypeinstallwhatwgemrWeakMapES3minimalcss-in-jssqsinputnumberfind-upes2016ECMAScript 2018preserve-symlinksObject.entrieswalkcloudformationbyteOffsetconnectES2019concurrencyObject.valuescontainsloadingmiddlewareECMAScript 2023pnpm9endpointaccessortapecallbindstreams2es2018logpromiseexecschemautilitiessetterECMAScript 2021offsetenvironmentformsjestvisualECMAScript 2017specFunction.prototype.nameerrorES2022intextrangeerrores7TypeScriptString.prototype.matchAlllinewrapcss variablesymboliamescapelesscsseverycomputed-typesequalityimportparsernativeArray.prototype.includesauthenticationcjkcompile lessjsonpathmatchStreamtypesaferdsECMAScript 6negative zeroefficientenderwebmake dirvariables in cssassertliveobjES2018exit-codestyletc39less compilerpersistent@@toStringTagmetadatacall-boundrm -framazonmomentredactmkdirpmrugetintrinsicstatetelephonestringifymapreducedeep-copylockfileprotocol-buffersMicrosoftformattinglimitedprivatejsxomit-0accessibilitybcryptbusyownfsArrayES5ObservablesignaldatarequestpicomatchdeepcopyES7JSONes-abstractrandomwatchingIteratorformatqspushfromURLSearchParamsuninstallextrafindLastspeedansimatchAllInt8ArraythrottledependenciesArray.prototype.flattenes8extensiontoStringTagcachearraybufferPushmimestyleguideoutputsyntaxurlwidthcloneeslint-plugintoobjectreadfast-deep-cloneES6deterministicmime-dbconcattyped arraycloudsearchtddstylingfast-cloneglobwhiches-shimsstarterbrowserslistchannelvaluelintchineseshebangflatwritebreakcolumnscliemitencryptionrapidinferencetrimStartlastbuffersbeanstalkwebsitettyglobalartpropgroupArray.prototype.flatMaptake
1.0.0

21 days ago