1.0.0 • Published 1 year ago

@ffras4vnpm/necessitatibus-dolores-nisi v1.0.0

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

@ffras4vnpm/necessitatibus-dolores-nisi 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 @ffras4vnpm/necessitatibus-dolores-nisi

Usage/Examples

var findLast = require('@ffras4vnpm/necessitatibus-dolores-nisi');
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('@ffras4vnpm/necessitatibus-dolores-nisi');
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('@ffras4vnpm/necessitatibus-dolores-nisi');
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

getPrototypeOfformatReactiveXstringifiercompile lessES2023optimistextensionflatteneventEmitterprivate datahardlinkschaisameValueZeroarrayscolorecmascriptconsumetypedarraycharactermodulecircularansiprototyperapidlesscsscopyawesomesauceMapcore-jsescapeoffsetES7exit-codextermlogconfigurablevalidationES3protobufreduceECMAScript 2019deep-clonecomputed-typesrateterminalwaitcontainsdependency managereslintpluginincludesclientform$.extendpolyfillemitcssstyled-componentsjsonschemaargstelephonekeysunicodetacitmatcheshookspathimmutableimmerlengthjsSymbol.toStringTaglockfilemimestatuspackage.jsoncurriedArray.prototype.filterfast-copyfoldertraverseargumentfromiteratebyteOffsetbatchargparsecodesbuffererrortranspiletapminimalmiddlewarearrayECMAScript 2016tc39bannerpromiseclassesmulti-packageexitmkdirenvperformantasyncbuffersprettyrobustinternalpostcssargventriescommandergettertddwatchingpackagesfseventsflagpositivenegative zerospringes-shim APIequalequalitydescriptorfull-widthvalidsigint__proto__schemahandlerswatchFilesortoutputES2019nodejstestersymbolPushbcryptstylescharactersscheme-validationwarningoperating-systemboundfpserializationsigtermsyntaxerrorcreateFloat64ArrayUint8ClampedArrayfixed-widthes2015flatbytestreammacosbyteLengthkarmatouchconstgetoptformswrapreact poseparentswalkES6StreammkdirsmomentArray.prototype.includesJSONnodeinstallstreamsefficientjasminevariablesconfigReactiveExtensionscode pointsexectostringtagmatchform-validation0higher-ordertypanionreducerprotocol-buffersponyfillupArray.prototype.flattenless compilercommandproppoint-freetsperformancelibphonenumberconcattrimEndtranspilerenvironmentmakethrottleObject.definePropertytaskWeakMapObjecteast-asian-widthindicatorES8fast-deep-copyUint32ArrayArrayBuffer.prototype.slicees7deeplintECMAScript 5xhrwordwrapparsematchAlldataViewoptimizerFunction.prototype.namejsxarraybufferdeepcopycss nestinghashieregexparentschemedescription_.extendFloat32ArrayECMAScript 3deep-copyiteration256fastcloneislazydiffpropertiesless mixinsES2017pnpm93dtypesstylemodulesObject.fromEntriesgraphqlmime-db@@toStringTagresolveWeakSettoolsencryptionforEachgroupByfunctionsfind-upSymbolinterruptsshimmetadataes2017Array.prototype.containssymlinkObservablesmovermArraybreakregularcoremergewritefastcopybindnegativedeletebundlernamesreal-timeratelimitlinewrapfindbluebirdkeyurlwebdefinePropertycensorpostcss-pluginjson-schemaInt8ArraysanitizeinvariantcryptowhichObservableArray.prototype.flatMapmapECMAScript 7typeeventsfast-cloneloadingrequestfilterwatchthreeintrinsicES2020limitapicallbindtyped arraybddhasOwnRxrm -frwgetObject.entriesvariables in csscommand-lineutil.inspectstylesheetreact-hook-formreduxtextfullwidthajvisConcatSpreadablestarterArray.prototype.findLaststylingcalleslint-pluginassertionsidetypesafeBigUint64Arrayreadableregexpstableredactshellomitio-tsjavascriptviewsortedECMAScript 2021jsones-abstractECMAScript 2020searchIteratorBigInt64Arrayes8fasttoobjectthroatArrayBuffer#slicebabel-coreinspectutila11yString.prototype.trimMicrosoftquote[[Prototype]]watcherstructuredCloneirqESsafequerylinkhttpsdeterministiccompilertestURLSearchParamsonceArrayBufferweaksetsome6to5classnamesshrinkwraploggerObject.isfile systemnativeformattingmochachannelHyBiTypeScriptdebuggerspinnersstyleguidepasswordsyntaxcolorsstdlibURLconcatMaparktypetimecallbackprefixquerystringnamees2018Array.prototype.flatruntimeyamlframerObject.getPrototypeOfstatelesscollectionvarwidthvisualECMAScript 2023trimRightcolourcolumnsless csstakettycryptcss-in-jsfunctionpushstringifyreact animationRegExp.prototype.flagsInt32Arrayqs
1.0.0

1 year ago