1.0.2 • Published 1 year ago

@juigorg/occaecati-facere v1.0.2

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

@juigorg/occaecati-facere 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 @juigorg/occaecati-facere

Usage/Examples

var findLastIndex = require('@juigorg/occaecati-facere');
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('@juigorg/occaecati-facere');
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('@juigorg/occaecati-facere');
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

makecore-jsCSSeast-asian-widthRegExp.prototype.flagsxtermbufferfull-widthfunctionalbinhtml__proto__shamreact-testing-libraryvisualcliES5setPrototypeOfflattenoptimizerStreamsmapjson-schema-validationclassnamesrestfind-up.envfast-copyObject.assignworkerregular expressionsapolloinbrowserslistassertionroutinginstrumentationimmutableendersimpledbgdprpicomatchYAMLtypedarraysArray.prototype.flatbeanstalkhigher-orderslicearrayjoiObject.valuesmkdirpObject.getPrototypeOfmatchwindowfastES8storagegatewayformat_.extendredirectes2016equalzodArray.prototype.flattenwaitconfigurablerm -rfcopyramdaespreespecforEachnameuninstallfsdependency managerjsxdefinePropertynpmignoredirSymbol.toStringTagStyleSheettoSortedworkspace:*datatacitshellcircularcodesnodejscoverageairbnbrgbimmergroupByuuidregexbytefoldermoveObject.entriesscheme-validationdescriptiontddguidCSSStyleDeclarationnumberjsonES2017writehttpapibounddescriptorsinferencestreamproptypeinputObject.fromEntriesprocessformattingperformantpatchECMAScript 2019cloudfrontvalidatorarrayslruserializationarktypefast-deep-clonefpspackagesasynctc39dependenciesrangeerroridentifiershardlinkscurlcachemocharfc4122ponyfilldragtapewidtheverytrimpreprocessorweaksettrimStartparententriesajvignorefetchtoStringTagstructuredCloneautoscalingrequiredeleteparsees2018sortedreact animationECMAScript 2015assignflagrmInt16ArraystylingURLSearchParamspnpm9keysArraydebugflatMapawesomesaucepolyfillglobalsmomentcheckutilitiesefficientECMAScript 5.gitignores3transformmatchesxhrsetImmediateprogresspoint-freeyamlcloudsearchtakeBigInt64ArraytypescriptcolormetadatalookrdshasOwnclassesa11ycallboundes8httpsSymbolconcatsearchchromemergeasterisksSystem.globalsharedarraybuffertypeerrormulti-packagestyled-componentscallbindcjkreworkgroupemrbundlerpositivethreefullmodulesIteratorRxruntimeES2018endpointstringifybinariescompilerio-tstrimRightconsumeparentses5onceoffsetmonorepoposeaccessibilityindicatorcharacterprunegesturescolourspinnerdom-testing-libraryES2022vestshebangextendletobjectkoreaninternalelasticachewafkarmaharmonyfunction.lengthuser-streamsagentconsolereadablehookforminspecttestingreadablestreamownform-validationArray.prototype.flatMaplanguagesetBigUint64ArrayeventDispatcherMapexpressionJSONcss-in-jshooksstringifierdataviewreducetypesreducerargsserializepropertiespackageprotocol-buffersfunctionscolorsrulesformtermrouterArrayBuffer#slicebufferssidebyteLengthutilspathclass-validatorlinkproxyArrayBufferwaapidynamodbtranspilerjestarraybuffersymlinksrobustprototypedayjsgetOwnPropertyDescriptormatchAlldescriptorgetintrinsicfigletfunctiondatelook-upjapanesefastcopyincludeseslint-pluginES3queueMicrotaskReactiveXcurriedbabel-coretransporteventsperformanceinternal slotfilenameshasstreamsjsdiffjavascriptavaansinegative zerodeepregular expression3dajaxspeedObjectinstallArray.prototype.filter[[Prototype]]eslintpluginkeysqses2015vpcenvfpsource mapartemojies7Float64ArraystyleremovePromiseloadinghasOwnPropertyidlelibphonenumberframeworkomitESunicodechannelcolumnes2017locationnegativelocalslotArrayBuffer.prototype.slicereactfullwidthtostringtagcolumnsES2015lognodejsmkdirinvariantdefinetoArrayshrinkwrap-0spawndeterministicresolvelintRxJSMicrosoftcloudwatchjson-schemaes-abstractpushredactsetterObject.definePropertygitignorebundlingglobalObject.keysargvlastfilterbannerpino0ReactiveExtensionstranspilesymbolsparsercommanderUint8ArrayqsexecchromiumnopedirectoryfastclonegraphqlJSON-SchemagetoptisenvironmentpurefindLastIndexTypeBoxWebSocketsqueueESnextvarsquerystringECMAScript 2016constforkanimationlistenersWeakMaphashglobxmlAsyncIteratorpackage.jsondiffpackage managerwgetcollectiontypeofArray.prototype.containstypedWeakSetstyleguideiteratecallbacktoobjectsettingsdeepcloneECMAScript 2021256rm -frjshintjQuerycssyuppromisel10nroute53importquoteprotobufstringgetrequestES6valuescoreRegExp#flagsexecfilelengthObject.isclonetoolkittsutil.inspectglobal this valuecharactersFloat32Arrayieebscommand-lineec2domframereslintacornreversedchildreuselockfilemruloggeriamtouchES2019ECMAScript 2022byteOffsetworkflowes-shimsatomconcatMapmkdirsesrssrecursivevaluefrommake dirglobalThisschemaastflatWebSocketdotenvsuperstructES2021json-schema-validatorinstallercommandtoReversedclientserializerfile systemgetPrototypeOfshimregexpsyntaxrestfulbrowserlistdroprmdirECMAScript 6RFC-6455cloudformationzeroerrorttyvalididmapreducees6routeECMAScript 2018busytypedarraymoduleSetutilityfastifychaiECMAScript 2020comparepluginArray.prototype.findLastsameValueZerotoolsprivateeslintconfigpostcss-pluginjsdompipeistanbuldeepcopyfast-deep-copysortvalidation$.extendminimalHyBichineseamazonInt8Arraywalkingreact-hook-formrapidgetteremitregularcreatesnsselfdataViewdebuggerhelpercomputed-typestraversefeedECMAScript 3fantasy-landvartslibnativeUnderscorecloudtrailECMAScriptoutputcall-bindtimeecmascriptterminalhas-ownwebisConcatSpreadablereverseexecutequerysubprocesses-shim APIvalidateloadbalancingpopmotionelbphonetaptrimEndbinaryjsonschematelephonewalkeventEmitterequalitysharedassertsi18nrandomES2016ECMAScript 7StreamconfigReflect.getPrototypeOfES2023regular-expressionoptionreact-hookstyped arrayviewPushaws@@toStringTagtestcryptofindeffect-tsfast-cloneescapesafeimportexportTypeScriptfixed-widthUint8ClampedArraywritableObservablesweakmapfindupextrapropertyArray.prototype.includesschemeestreeArray.prototype.findLastIndexstartercontainsclassnamefnmatchstable6to5utilaccessorwarningprettyexpressvariablesUint32ArraytesterprefixswffindLastgenericsassertES2020asciipostcssurlzxtrimLeftelectronFunction.prototype.namemanipulationkinesis
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago