4.6.85 • Published 11 months ago

@hishprorg/minus-repellat v4.6.85

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

@hishprorg/minus-repellat 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('@hishprorg/minus-repellat');
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('@hishprorg/minus-repellat');
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('@hishprorg/minus-repellat');
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

getPrototypeOfremovesnseast-asian-widthhardlinkshigher-orderexpresscloudformationequalES2019apiroute53isjsonschemastyleguidedependenciesclassesshrinkwraplockfiledefineArray.prototype.flatmomentestreereact posefindLastIndexBigInt64Arrayutil.inspectWeakSettoolkitdeletespinnerrdsdynamodbobject3ddebugbusymanipulationsubprocessdeepcopypathprototypemodulesURLSearchParamsrecursiveproxyimportJSONpolyfillhtmlhttpArray.prototype.findLastIndexmrucore-jsbinariesString.prototype.matchAllSetglobalsvarsString.prototype.trimrgbmatchAllbddArrayasyncstreamwalkchineseinmkdirpwaffast-deep-copynope256serializedeepcloneES3awsstringpreprocessorinternal slotargumentfunctionStyleSheetjoiurlpatchformtrimEndworkflowhasl10nbuffersecmascriptdatapluginperformantagentartstylearraysortasterisksUint8ArraysomesetPrototypeOffastifycall-bindutilsSymbolajvmanagervestMaplastgenericsfiletoArraybinECMAScript 3apolloloadbalancingeventEmitterlrudirectoryarraybufferoncetoolsObject.valuesmulti-packagecloudsearchdomObject.keysYAMLtestingWebSocketshookformeslintpluginrm -rfs3computed-typestermchrometypedarrayselectronidlestylessharedECMAScript 2019Object.fromEntriesroutemakereversedimportexportES6descriptionexecuterm -frObject.entriesjeststoragegatewaypackage managershellfixed-widthmovevalidationsuperagentECMAScript 2023fullwidthvalidatorES5tapesidemkdirwaapicloudwatchshebangreworkownpushcommand-linechromiumnamesentriesmetadatajsdiffassertiona11ysyntaxerror[[Prototype]]instrumentationstringifierconstdeep-copyregexqsReflect.getPrototypeOfespreefpinferencejavascriptes8whatwgtoReversedwarningidECMAScript 7visualupspawngetOwnPropertyDescriptorramdaJSON-SchemajQuery
4.6.85

11 months ago

4.6.84

11 months ago

4.6.83

11 months ago

4.6.82

11 months ago

4.6.81

11 months ago

4.6.80

11 months ago

4.6.79

11 months ago

4.6.78

11 months ago

4.6.77

11 months ago

4.6.76

11 months ago

4.6.75

11 months ago

4.6.74

11 months ago

4.6.73

11 months ago

4.6.72

11 months ago

4.6.71

11 months ago

4.6.70

11 months ago

4.6.69

12 months ago

4.6.68

12 months ago

4.6.67

12 months ago

4.6.66

12 months ago

4.6.65

12 months ago

4.6.64

12 months ago

4.6.63

12 months ago

4.6.62

12 months ago

4.6.61

12 months ago

4.6.60

12 months ago

4.6.59

12 months ago

4.6.58

12 months ago

4.5.58

12 months ago

4.5.57

12 months ago

4.5.56

12 months ago

4.5.55

12 months ago

4.5.54

12 months ago

4.5.53

12 months ago

4.5.52

12 months ago

4.5.51

12 months ago

4.5.50

1 year ago

4.5.49

1 year ago

4.5.48

1 year ago

4.5.47

1 year ago

4.5.46

1 year ago

4.5.45

1 year ago

4.5.44

1 year ago

4.5.43

1 year ago

4.5.42

1 year ago

4.5.41

1 year ago

4.5.40

1 year ago

4.5.39

1 year ago

4.5.38

1 year ago

3.5.38

1 year ago

3.5.37

1 year ago

3.5.36

1 year ago

3.5.35

1 year ago

3.5.34

1 year ago

3.5.33

1 year ago

3.5.32

1 year ago

3.5.31

1 year ago

3.4.31

1 year ago

3.4.30

1 year ago

3.4.29

1 year ago

3.4.28

1 year ago

3.4.27

1 year ago

2.4.27

1 year ago

2.4.26

1 year ago

2.4.25

1 year ago

2.4.24

1 year ago

2.4.23

1 year ago

2.4.22

1 year ago

2.4.21

1 year ago

2.4.20

1 year ago

2.4.19

1 year ago

2.3.19

1 year ago

2.2.19

1 year ago

2.2.18

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago