3.6.71 • Published 11 months ago

@hishprorg/recusandae-at-at v3.6.71

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

@hishprorg/recusandae-at-at 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/recusandae-at-at

Usage

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

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

sameValueZerosharedlastcensordependenciestypedarrayvarflattenownspecassertsgesturesjson-schema-validationenvironmentflagRxvisualshamtrimLeftbabel-corecss nestingregularECMAScript 2023somestylesidlenodejsdeepforkreact animationdeletesharedarraybufferbuffercall-bindestreespinnersclassnametranspilecollectionserializermrugetPrototypeOfawesomesauceutilsUint8ClampedArrayredux-toolkitoptimiststreambundlingreversecircularStyleSheetwindowtypedstablehardlinksjsonpopmotionfluxstylingglobalThispredictableregular expressionArray.prototype.containsglobalutilitytypescommandcss variablejoiformattingecmascriptprotobufdefinePropertycommand-linetranspilermodulesslotqsminimalauthenticationreal-timeES2021unicode_.extendobjectgdprpackage.jsonarraybufferes-shimscloudfrontcurriedjwtsymlinkfixed-widthPushyupselfopensslimmerenvrfc9562eventscopypropertyttyFloat32Arrayharmonynegative zerotddtacittesterinspectspeednumberlibphonenumberwhatwgtoSortedArray.prototype.flattengenericsuser-streamses-abstracteventDispatcherfast-clone6to5Object.valuesfindLastfind@@toStringTagWeakMapES3CSSponyfillchildfpsESnextparsingreact-componentconfigcachelogginghasOwnsuperagentspringsignedroutequeueMicrotaskindicatorObject.keysSetreadablestreamtsconcatMapECMAScript 7errordatees2015wafsyntaxerrormomentletweaksetlocalloadbalancingacornxhransihelpersdynamodbjsdiffes2017inputdayjstypedarraysReactiveXutilitiesjsonschemapostcsssnssequenceECMAScript 2021Array.prototype.flatMapReflect.getPrototypeOfpolyfillstringmapreducereact-hooksmobilecloudformationtestingflatbindcolumnsInt8Arrayes-shim APIescapechromeserializationmoveregexpfunctionalfunction.length-0core-jssideisjsxECMAScript 3eslintconfigobjroutingdescriptorsString.prototype.trimlistenersreducerES2017Object.isJSON-Schemascheme-validationiamreactSystem.globalprefixECMAScript 6inairbnbdataViewfastifyuuidglobECMAScript 2022packagestestinternal.gitignorearrayscallbindkeyreact-testing-libraryformsprettyroute53ECMAScript 2015arktypeimportpreprocessorec2utilshellUint16Arrayremoverfc4122koreanredacttermdropaccessorTypeBoxrapidphonebootstrap csspasswordsignalsprivate dataapollolessgitignoreworkflowfromhttpstrimEndpreserve-symlinksmergeshrinkwrapposetyped arrayelbfsarrayasyncvaluechannelvalidatepositivebrowserrequestmatchAlljsfastl10ntelephonewgetsetES2018figlettypanionreadabletoolsArray.prototype.includestoStringTagSymbol.toStringTagdotenvajvStreamsArray.prototype.flathandlerscomputed-typesES2019flatMapwarninghasOwnPropertyhotcoerciblebyteOffsetprivateHyBijshintbyteLengthdomsimpledbio-tsless cssCSSStyleDeclarationplugincheckintrinsicRxJSeffect-tswalkECMAScript 2019toReversedECMAScript 5constBigInt64Arrayexitserializefile systemargvgetOwnPropertyDescriptorfantasy-landhookstoobjectdeepcopyiei18ntextcloudwatchclass-validatorvalidatormulti-packagezodAsyncIteratorpinodirdeep-cloneES8enderiterationbabelshebanges2016Object.definePropertyES7assertfunctionsreact posewaapiclonergbimportexportsignalcommanderincludesES2022datastructureWebSockettoArraysubprocessxtermframeres5Promisevestutil.inspectbootstrap lessagentUint32Arrayoffsetprotopnpm9ArrayBufferbddURLSearchParamsajaxpatchinstalllinuxfindLastIndexexecfileelmcolumnbusyfullwidthoptimizergroupByjeststarterbytecallloadingastECMAScript 2017nativekinesisawsspawntostringtagObservablesdefineeslint-pluginirqES2023sqstypewhichbuffers3dcryptRFC-6455typeerrorjson-schemaexit-codehasbeanstalkmodulepersistentcharacterReactiveExtensionsfilterendpointMicrosoftlruoperating-systemcompilerrequirestreamsTypeScript.envnodenpmignorees6ebscallbackhashcall-boundUnderscoreglobal objectES2020eslintstringifiernameencryptionmonorepoArray.prototype.findLastUint8ArraymetadatasafeemrString.prototype.matchAllbundlerenumerablemakeless.jsdescriptorECMAScript 2018east-asian-widthbrowserlistuploadamazonquotezxschemaidentifiersArray.prototype.filtersuperstructstateclireduxObject.entriessyntaxforEachconsumesigtermjQueryspinnerRegExp#flagsrangeerrorEStraversesymbolasterisksresolveYAML$.extendelasticacheconcatsetImmediateuninstallnegativeECMAScript 2016setteres8livevpcstatusglobal this valuebinarypicomatchprocess256reducegradients css3lesscssnamesstyled-componentscollection.es6getcryptocreateperformanceinferenceignoreyamlsortdependency managerexpressionURLa11yfull-widthfunctionregexObservablestoragegateway
3.6.71

11 months ago

3.6.70

11 months ago

3.6.69

11 months ago

3.6.68

11 months ago

3.6.67

11 months ago

3.6.66

11 months ago

3.6.65

11 months ago

3.6.64

11 months ago

3.6.63

11 months ago

3.6.62

11 months ago

2.6.62

11 months ago

2.6.61

11 months ago

2.6.60

11 months ago

2.6.59

11 months ago

1.6.59

11 months ago

1.6.58

11 months ago

1.6.57

11 months ago

1.6.56

12 months ago

1.6.55

12 months ago

1.6.54

12 months ago

1.5.54

12 months ago

1.5.53

12 months ago

1.5.52

12 months ago

1.5.51

12 months ago

1.5.50

12 months ago

1.5.49

12 months ago

1.5.48

12 months ago

1.5.47

12 months ago

1.5.46

12 months ago

1.5.45

12 months ago

1.5.44

12 months ago

1.5.43

12 months ago

1.5.42

12 months ago

1.5.41

12 months ago

1.5.40

12 months ago

1.5.39

12 months ago

1.4.39

12 months ago

1.4.38

1 year ago

1.3.38

1 year ago

1.3.37

1 year ago

1.3.36

1 year ago

1.3.35

1 year ago

1.3.34

1 year ago

1.3.33

1 year ago

1.3.32

1 year ago

1.3.31

1 year ago

1.3.30

1 year ago

1.3.29

1 year ago

1.3.28

1 year ago

1.3.27

1 year ago

1.3.26

1 year ago

1.3.25

1 year ago

1.3.24

1 year ago

1.3.23

1 year ago

1.3.22

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.3.17

1 year ago

1.3.16

1 year ago

1.3.15

1 year ago

1.3.14

1 year ago

1.3.13

1 year ago

1.3.12

1 year ago

1.3.11

1 year ago

1.3.10

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago