2.4.76 • Published 2 years ago

@hishprorg/vitae-laudantium v2.4.76

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@hishprorg/vitae-laudantium 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 @hishprorg/vitae-laudantium

Usage

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

var includes = require('@hishprorg/vitae-laudantium');
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

hasOwnPropertyprotobufdom-testing-libraryjson-schemacss lessES6URLSearchParamscsssortnodejsimmutablefastwindowstakebcryptfindLastIndexscheme-validationObject.isbincircularargvUint16ArrayjestclientSymbolMaptoStringTagObservablezodes86to5comparecolorprivate datasymlinksparsecolumnRxJSpnpm9regexansiflaglibphonenumberzxsafepropclonegesturesinES2015ES8Array.prototype.flatdayjsECMAScript 6StreamsmkdirsrobustStyleSheetenumerablejavascriptvalidationtacitJSON-SchemasignaldefinePropertymacosjsontypedspawnzeroconsolestructuredClonecertificatescodestextopensslURLes2016matcheserroreventDispatcherES2020fullincludesresolveartnativepropertyminimalidlelistenersconfigurablequotedataViewuser-streamsArray.prototype.findLastIndexnameReflect.getPrototypeOfsetterredirectsameValueZerocheckcollection.es6ES2018vpcECMAScript 2017querystringreact animationglobalThisglobObject.entriesjsonschemapositiveconcatMapawsutil.inspectinterruptsmatcheslintpluginextratestingassertequalreduceUnderscorepureajaxstateconstnpmignoregradients csspicomatchhigher-ordervaluefast-clonespringbindpersistentpreprocessorkoreancommanderignoretostringtaglockfile$.extendl10nfigletECMAScript 2020popmotionspinnerscurriedreadArray.prototype.filtercoercibletoSortedrulesargumenttrimEndsuperstructbyteLengthstatussignedAsyncIteratorcharacterproxyclassesrdselectronec2Uint8ArrayxtermownPromisecloudfrontintrinsices2017binariesbeanstalkes2018Int16ArrayCSSinferenceapiredactbytePushoperating-systemenderspeedbrowserlistimportclassnamecloudformationamazontoolkittypescriptgenericsstableequalityECMAScript 5lastsuperagent@@toStringTagmake dirArrayBuffer.prototype.sliceObject.values3dserializationshimlrulesscssxhrwafsequenceprototypeECMAScript 7starterwarninges7regexpsymbolstimepostcssgetterroutingbootstrap csspreserve-symlinkssyntaxerrordescriptortraverseiterationeast-asian-widthoutputdeepeslinteslintconfigESnextdeepclonecachestylingpluginES2016importexporteslint-pluginhooksyupiteratorJSONes2015descriptionhookformstyleseventEmitterstringifierwgetES2021dropcurlstyled-componentsvariables in cssphoneglobal this valuebabelsettingscoregroupBycore-jssubprocessbundlingshellArray.prototype.flatMapdeletepolyfillcloudtrailmonorepopostcss-pluginlinuxterminalrangeerrorthreeagentformatsyntaxchromenegativenameslogletreact-hook-formfast-copyslotmobilemockingelmfastcloneflattenmruWeakMapsqses-shim APIdependency managerjsxdefineprivateform-validationwalkistypanionweaksetwidthtypeerrorcryptofast-deep-cloneautoscalinges-shimsextendECMAScript 2015fpscall-binddeterministiclocationTypeBoxcomputed-typesswfmoduleframeroptimistFloat64Arraystyleguidefile systemformnpmbabel-corefilefastcopyes6unicodestoragegatewaysnsArray.prototype.findLastboundmomentjapanesedatesidesymbolchinesesharedarraybuffercontainsirqtyped arrayiteratemapreduce.envurljson-schema-validatorfluxqueueMicrotasktypedarrayFunction.prototype.nameaccessibilitytslibWebSocketsquerywritecolorsECMAScript 2016css nestingpathlazyserviceexecvalidatorinternaltoolsObject.fromEntriesvisualutilitiesgetopt
2.4.76

2 years ago

2.4.75

2 years ago

2.4.74

2 years ago

2.3.74

2 years ago

2.3.73

2 years ago

2.3.72

2 years ago

2.3.71

2 years ago

2.2.71

2 years ago

2.2.70

2 years ago

2.2.69

2 years ago

2.2.68

2 years ago

2.2.67

2 years ago

2.2.66

2 years ago

2.2.65

2 years ago

2.2.64

2 years ago

2.2.63

2 years ago

2.2.62

2 years ago

2.2.61

2 years ago

2.2.60

2 years ago

2.2.59

2 years ago

2.2.58

2 years ago

2.2.57

2 years ago

2.2.56

2 years ago

1.2.56

2 years ago

1.2.55

2 years ago

1.1.55

2 years ago

1.1.54

2 years ago

1.1.53

2 years ago

1.1.52

2 years ago

1.1.51

2 years ago

1.1.50

2 years ago

1.1.49

2 years ago

1.1.48

2 years ago

1.1.47

2 years ago

1.1.46

2 years ago

1.1.45

2 years ago

1.1.44

2 years ago

1.1.43

2 years ago

1.1.42

2 years ago

1.1.41

2 years ago

1.1.40

2 years ago

1.1.39

2 years ago

1.1.38

2 years ago

1.1.37

2 years ago

1.1.36

2 years ago

1.1.35

2 years ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.31

2 years ago

1.1.30

2 years ago

1.1.29

2 years ago

1.1.28

2 years ago

1.1.27

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago