1.0.0 • Published 25 days ago

@ryniaubenpm/quo-saepe-laudantium v1.0.0

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

@ryniaubenpm/quo-saepe-laudantium Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES5 spec-compliant Array.prototype.filter 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 spec.

Because Array.prototype.filter depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.

Example

var filter = require('@ryniaubenpm/quo-saepe-laudantium');
var assert = require('assert');

assert.deepEqual(filter([1, 2, 3], function (x) { return x >= 2; }), [2, 3]);
assert.deepEqual(filter([1, 2, 3], function (x) { return x <= 2; }), [1, 2]);
var filter = require('@ryniaubenpm/quo-saepe-laudantium');
var assert = require('assert');
/* when Array#filter is not present */
delete Array.prototype.filter;
var shimmedFilter = filter.shim();
assert.equal(shimmedFilter, filter.getPolyfill());
var arr = [1, 2, 3];
var isOdd = function (x) { return x % 2 !== 0; };
assert.deepEqual(arr.filter(isOdd), filter(arr, isOdd));
var filter = require('@ryniaubenpm/quo-saepe-laudantium');
var assert = require('assert');
/* when Array#filter is present */
var shimmedFilter = filter.shim();
assert.equal(shimmedFilter, Array.prototype.filter);
assert.deepEqual(arr.filter(isOdd), filter(arr, isOdd));

Tests

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

utilitiesfunctionalbundlertermsomefastfoldertddlogisConcatSpreadablebrowserslistHyBijoitakedebuggerterminalexitObject.entriestrimstyleses2016fullwidthvestdeepexpressionframeworkgetwebArray.prototype.findLastJSONbannermime-dbstdlibiterationes2017optiontapedatawordbreaksharedRxJScommandtranspilecensortrimStartrmvariablesfind-upsanitizeawaitboundramdaESnexthardlinkstypedarrayapicollectionparseCSSreadfantasy-landtypeerrorforEachdayjsecmascriptArray.prototype.filterutilityweaksetfullshellchromeutilsperformantsetPrototypeOfwordwrapES3corereducestyleguide__proto__robustawesomesaucefunctionsFloat32ArraysliceMapcolorbusydependency manageri18nfixed-widthgetterless mixinsdescriptorsECMAScript 2015eventstypescriptavacoercibleelectronairbnbspinnerartsidecryptobatchwraprecursivebundlingredux-toolkitwidthratelimitsigtermtoolsobjstylemovespringdom-testing-librarykoreannameUint32Arrayes7streamcall-boundformattingArray.prototype.includesmixinsminimalspecECMAScript 2021dotenvjavascriptjwthookformaccessibilitystatelessexit-codetypanionestreefindjsdomflatMapwaapipackage.jsoncolumnssymbolintrinsicdeterministicassertenvironmentconsoleRegExp.prototype.flagsyuppicomatchsafesyntaxlrureact-hook-formInt32ArraylookStreamexpressclassnamesUnderscoreflattenkeysFloat64ArrayhashUint8Arrayes8class-validatorjestinstallerfigletArrayBufferthrottlepurestyled-componentsdataViewjsonschemafast-cloneauthenticationlastarraypackage managernegative zerocallbackserializelintargslistenerspersistentcjkframerfpObservablesa11yArray.prototype.flatMapqueueloadingexecconcurrencyES6css nestingconnectSymbol.toStringTagES2018mkdirsstreams2karmaoptimizerdescriptorAsyncIteratorconcatMapstructuredCloneprune_.extendIteratorgdprdiffpackagesirqes-abstractcommand-linetoStringTagiteratorpasswordES2020containsproprmdirloggingtslibpropertyECMAScript 2017toucheventDispatchervaluetesterreducerpostcss-pluginform-validationregexString.prototype.matchAllwatchFilebreakmiddlewareview
1.0.0

25 days ago