1.1.20 • Published 8 days ago

@devtea2026/cumque-numquam-minima-ad v1.1.20

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

@devtea2026/cumque-numquam-minima-ad Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES7/ES2016 spec-compliant Array.prototype.includes 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.includes depends on a receiver (the this value), the main export takes the array to operate on as the first argument.

Engines that need this package include:

  • IE (all versions)
  • Safari < 9
  • Firefox < 43, and 99-101
  • Chrome < 47
  • Edge < 14
  • node < 6

Getting started

npm install --save @devtea2026/cumque-numquam-minima-ad

Usage

Basic usage: includes(array, value, fromIndex=0)

var includes = require('@devtea2026/cumque-numquam-minima-ad');
var assert = require('assert');
var arr = [ 'one', 'two' ];

includes(arr, 'one'); // true
includes(arr, 'three'); // false
includes(arr, 'one', 1); // false

Example

var arr = [
	1,
	'foo',
	NaN,
	-0
];

assert.equal(arr.indexOf(0) > -1, true);
assert.equal(arr.indexOf(-0) > -1, true);
assert.equal(includes(arr, 0), true);
assert.equal(includes(arr, -0), true);

assert.equal(arr.indexOf(NaN) > -1, false);
assert.equal(includes(arr, NaN), true);

assert.equal(includes(arr, 'foo', 0), true);
assert.equal(includes(arr, 'foo', 1), true);
assert.equal(includes(arr, 'foo', 2), false);
/* when Array#includes is not present */
delete Array.prototype.includes;
var shimmedIncludes = includes.shim();

assert.equal(shimmedIncludes, includes.getPolyfill());
assert.equal(arr.includes('foo', 1), includes(arr, 'foo', 1));
/* when Array#includes is present */
var shimmedIncludes = includes.shim();

assert.equal(shimmedIncludes, Array.prototype.includes);
assert.equal(arr.includes(1, 'foo'), includes(arr, 1, 'foo'));

Tests

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

idlecssObject.entriesprunees2015@@toStringTagsesstringifywarningIteratorcharactergetPrototypeOfsnskarmaArray.prototype.containses8emitfindLastIndexECMAScript 2015mkdirpECMAScript 2022WebSocketisConcatSpreadablees2018wafbluebirdmomentnames$.extendobjtoStringTagguiddayjsfseventsform-validationHyBisetPrototypeOfhttpjQueryroute53reducermiddlewarereplayfunctionalconfigESpathiterationmatches-0classnameregexjwtworkflowfigletoutputparseURLSearchParamsRegExp.prototype.flagsRFC-6455JSON-SchemaES5mrulanguageajaxless cssnegative zeroconsoleschemeTypeBoxArray.prototype.filtercharacterspatchchaiES2022monorepopolyfillwritablevariables in cssstyleguideelboperating-systemcoreomitprivateMicrosoftschemaflatMapincludessettypescripttypanionnodejskeyses2017weaksetcompile lesstypedarrayObservableparentslistenersutilargumentelasticachearrayupwalkterminalmovecensorclientasyncserializeequalityruntimewatchingYAMLecmascriptloadbalancingenvironments.envrouterttytypeastWeakSetthroataccessibilitysetImmediateECMAScript 2018sigintlinkauthelmwaitenvbootstrap lessuuidduplexpackage managerstringifierinputbundlingtestingnativejsmatchidfast-deep-clonesymlinkshardlinkshas-owntoArrayidentifiersworkspace:*cloudwatchforEachimportexportpackage.jsona11ystreamsextendinferencerapidwhatwgflagdeep-copybuffersuperagentpredictablevisualshebangexpressiontyped arrayinterruptstouchtestpostcss-plugintslibnested cssObject.isweakmapmkdirairbnbec2WeakMapdataviewsymlinkoptimizersearchwriteflagsmergehookscommandercallbounderror-handlingscheme-validationparsingsafetrimLeftfunctionschromeaccessorawesomesaucejshintopenjapaneseinstallsyntaxformkoreanfromveststringcode pointsless compilerparserpostcssArray.prototype.flatMapstatesorteslintconfiginspectrm -rfpropertyhastypeerrorlimitformatkeyuninstallinternal slotmodulelessurlgetintrinsics3requireserializationeventEmitterajvhasOwnwhichefficientlimitedObject.keyscloudtrailresolvemimeconfigurablePromisetoolsCSSnegativeserializerArrayBuffer#slicergbdeepcloneiamECMAScript 3typedarrayscreateclivarsclassesdescriptionAsyncIteratorprocessvaluespositivecollection.es6copyspeciteratorsigtermconcatMapbatchtrimRightshimvalidateECMAScript 2017awaitgetopteslintpluginworkerhookformrmframeworkURLapolloi18nexeccss lessspinnershellassignfindslotemojireadgraphqlthrottleprogressPushwindowspropertiesdependenciesbyteOffsethandlersCSSStyleDeclarationsuperstructObjecttddfast-clonecolumneast-asian-widthsignalstoragegatewayfunctionconnectcheck
1.1.20

8 days ago

1.1.19

9 days ago

1.1.18

10 days ago

1.1.17

11 days ago

1.1.16

12 days ago

1.1.15

13 days ago

1.1.14

14 days ago

1.1.13

15 days ago

1.1.12

16 days ago

1.1.11

17 days ago

1.1.10

18 days ago

1.1.9

19 days ago

1.1.8

20 days ago

1.0.8

21 days ago

1.0.7

22 days ago

1.0.6

23 days ago