1.0.0 • Published 2 months ago

@hoangcung1804npm/molestiae-repellat-perspiciatis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@hoangcung1804npm/molestiae-repellat-perspiciatis Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.findLast 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.findLast 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 @hoangcung1804npm/molestiae-repellat-perspiciatis

Usage/Examples

var findLast = require('@hoangcung1804npm/molestiae-repellat-perspiciatis');
var assert = require('assert');

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

assert.deepEqual(findLast(arr, isNumber), 3);
var findLast = require('@hoangcung1804npm/molestiae-repellat-perspiciatis');
var assert = require('assert');
/* when Array#findLast is not present */
delete Array.prototype.findLast;
var shimmed = findLast.shim();

assert.equal(shimmed, findLast.getPolyfill());
assert.deepEqual(arr.findLast(isNumber), findLast(arr, isNumber));
var findLast = require('@hoangcung1804npm/molestiae-repellat-perspiciatis');
var assert = require('assert');
/* when Array#findLast is present */
var shimmed = findLast.shim();

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

Tests

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

dirpostcssmomentparsehigher-orderratelimitcall-bindECMAScript 2017extensionlintentriesWeakSetObservableES5fast-deep-clonecollectiontapiteratearraysclassnamesArray.prototype.flattenpathsuperagentproto_.extendrequestES2022dynamodbdom-testing-libraryfindLastdeep-cloneenvironmentvaluesUint32ArrayObservablesconcatMapjQueryajvredux-toolkitglacierconsolermdirtddfileloadbalancingreducerdefineloadingStyleSheetformcode pointseslintpluginbundlingreactexeceventDispatcherimporttypanionqueueMicrotaskcolumnscss nestingcssfindLastIndexpushjavascriptObject.ispromisessetImmediatejwtArray.prototype.filterserializerchromiumECMAScript 2019reuseextendmakecallbindphoneflagstesterwatchingtostringtaggraphqlchaimatchAllrm -rfstylefunctionalassertsdatastructurefastoutputsymbolextraES2017hardlinksmetadatamobilepatchespreehelpersjsonceindicatorsestaskgdpreast-asian-widthcharactergetwidthin-0assertionstyleguidereact-hook-formflagtypedarrays$.extendwritableless.jstypesafequoteperformanceSetmatchescryptstylesswfcachecurlutilitiesi18nnativenumbermappropertyclass-validatorECMAScript 2018testingcjkcensordebuggerproperties@@toStringTagsetPrototypeOfECMAScript 7toStringTagBigInt64Arraycloudsearchregularfast-deep-copy__proto__URLfastclonewatchFilestreamequalitynopesymlinksliveconsumetoobjectcircularES2015visualrgbjestsearchsnsES2016hasOwnbluebirdpredictablelanguageformserrorECMAScript 5sqspostcss-pluginlimitFunction.prototype.namebatchratedataViewfilterfigletfastcopysymbolsponyfillhottestlimiteddeepcopyreplayrecursiveassignkarmamake dirrapidsetterglobxtermfullmergeobjectoptimisttakefast-cloneserializeES2019positiveES2020datedotenvtypednegativeesunicodemoduleutilitycoerciblecliqueueimportexportcloudfrontsimpledbutilinspectmonorepozerofastifyinstallerSymbolfixed-widthpackage.jsonArrayBuffer.prototype.sliceenumerableimmutablesuperstructfromES2023starterTypeBoxflatMapfsevents.envArray.prototype.findLastIndexpicomatchpluginlibphonenumberjsdomless mixinsutil.inspectcloudformationbusybytestringifierWebSocketajaxtelephonecodescommand-linemruFloat32ArraytslibES2018datarfc4122syntaxerrorstatedependency managertraversenodejsserializationclientbyteLengthloggingbrowserslistgetternamesec2deep-copyes5trimStartArrayBuffer#slicepolyfillrequirechecklinewrapbindSymbol.toStringTagPromiseomituuidinvariantstringifyinputtypeerroreveryscheme-validationObject.valuesclassnameinternal slotcallboundendergenericsttydescriptorsbcryptES6idframeworkless compilercolorsprivateisConcatSpreadablewritejasminewarningstringargsbannersyntaxregular expressionslastwordwrapfast-copyebsequalwatcherlistenersECMAScript 2021tc39structuredCloneconcurrencyECMAScript 2015trimreact-hookscallthrottleprotocol-bufferseventEmitteramazonbddhasString.prototype.matchAllTypeScriptES2021routesortedRxJSArrayBufferstatelesscss-in-jslesslookrmconfiges2016reduceresolveObject.keysfullwidthstoragegatewayauthenticationtsFloat64ArraymkdirspasswordmkdirpuninstallwgetInt32ArraystdlibcopyshimparserObject.fromEntriesArray.prototype.flatMapsequenceweaksetsharedvalidremoveschemarobustpackage managerwhatwgpropeslint-plugincss lessperformantcloudtrailArrayreact-testing-libraryiteratoropenprogresssortwhichcallbackforEachnamespectrimRightownmime-dbjsxregular expressionbeanstalkfile systemterminalquerystringvestbuffersreadableInt8Arrayroute53authasyncdayjslesscssgradients cssxhrcompilerRegExp#flagsfsvalidationtyped arrayReflect.getPrototypeOfgetPrototypeOfkeyjapanesepruneelasticachelinkObject.entrieses6Objectvaluethroats3
1.0.0

2 months ago