1.0.0 • Published 15 days ago

@rabiepenpm/quidem-similique-ipsam v1.0.0

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

@rabiepenpm/quidem-similique-ipsam 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('@rabiepenpm/quidem-similique-ipsam');
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('@rabiepenpm/quidem-similique-ipsam');
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('@rabiepenpm/quidem-similique-ipsam');
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

eventDispatchercallboundimportwraplinuxchrometrimtc39prettyexpressionartcircularmkdirrfc4122efficientpackage.jsontoSortednativehookformserializelanguagecoerciblepropertiesreduceTypedArraychromiumtypemonorepocloneduplexSettaskcallbindcreateURLSearchParamsauthenticationcurlcommandtyped arrayrecursivejavascriptWeakMapObject.valuesextendrm -frshebanggraphqlgetPrototypeOftslibStreamsBigUint64Arraydependenciestapdatenested cssJSONperformancemiddlewaredebuggerquotecorsmkdirpwatchFileincludeszerospeedArraymimehttpspnpm9YAMLhashformAsyncIteratorWebSocketpipeformatposeObject.definePropertyArrayBuffer.prototype.slicees2018keyscss variablevalidatefrompostcss-pluginanimationshamjoitraversecompareObject.entriesECMAScript 2016findupxhrawesomesaucespinnerses6babelsiginttrimEnddeepsuperstructdefinecryptotoobjectexit-codeUint16Arraypasswordeslintpluginprototypeiteratorbcryptcomputed-typesemojipyyamlbluebirdindicatorassertionclass-validatorjsonSymboljsxutilitytoolkitjson-schema-validationframeworkwidthReactiveExtensionslruObject.fromEntriesargsES2020timeFloat64ArrayArray.prototype.containsargvInt32ArrayES2021regularargparsees8deepclonesomeIteratorfilequerythroatarraybufferTypeBoxlinewrapresolvedeleteenvironmentharmonyutilitiesquerystringurlstringifyassertqueuemulti-packageconsoleqsfast-deep-copyramdaguidbannervaluesUint32ArraylesssyntaxerrorECMAScript 2022testerArray.prototype.flatMapbyteOffsetfasthookskeyvalueBigInt64ArraytoStringTagserializereslintconfigbrowseroptimizerpolyfilloptimisttakebabel-coreaccessortouchjsonpath$.extendsigtermdescriptorstypeofrmdirfast-copypromiseschanneloption[[Prototype]]reduxlastslicehttppositivebrowserlistcolorses7shellstylingframergroupsymbolcommand-lineES5es-shimses2016chaiairbnbrequesttoArraydropajaxerrorreact poseString.prototype.matchAllparenthascall-bindbreakwarningECMAScript 2020es-abstractECMAScript 6getcopysettingsfunctionsargumentwalkingarraysymlinkFunction.prototype.nameparentsreadablestreamyamlpromiseclientponyfillstatus3dirqstringmomentmruwaapiless cssespushstdlibmimetypesprotobufrapidwebdotenvCSSStyleDeclarationgetOwnPropertyDescriptorES2016getintrinsicbatchcorelibphonenumberworkspace:*core-jsObservablepersistentqueueMicrotaskfptypedarrayexpressfunctionalmkdirsUint8Arrayrgbstreams2Object.assignECMAScript 2023nameconfigurablemixinstextfs
1.0.0

15 days ago