2.4.76 • Published 11 months ago

@hishprorg/vitae-laudantium v2.4.76

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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

11 months ago

2.4.75

11 months ago

2.4.74

11 months ago

2.3.74

11 months ago

2.3.73

11 months ago

2.3.72

11 months ago

2.3.71

11 months ago

2.2.71

11 months ago

2.2.70

11 months ago

2.2.69

11 months ago

2.2.68

11 months ago

2.2.67

11 months ago

2.2.66

11 months ago

2.2.65

12 months ago

2.2.64

12 months ago

2.2.63

12 months ago

2.2.62

12 months ago

2.2.61

12 months ago

2.2.60

12 months ago

2.2.59

12 months ago

2.2.58

12 months ago

2.2.57

12 months ago

2.2.56

12 months ago

1.2.56

12 months ago

1.2.55

12 months ago

1.1.55

12 months ago

1.1.54

12 months ago

1.1.53

12 months ago

1.1.52

12 months ago

1.1.51

12 months ago

1.1.50

12 months ago

1.1.49

12 months ago

1.1.48

12 months ago

1.1.47

1 year ago

1.1.46

1 year ago

1.1.45

1 year ago

1.1.44

1 year ago

1.1.43

1 year ago

1.1.42

1 year ago

1.1.41

1 year ago

1.1.40

1 year ago

1.1.39

1 year ago

1.1.38

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.35

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.30

1 year ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

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