{"name":"array-includes","version":"3.1.9","author":{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"},"funding":{"url":"https://github.com/sponsors/ljharb"},"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"description":"An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.","license":"MIT","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","pretest":"npm run --silent lint","test":"npm run --silent tests-only","posttest":"npx npm@\">= 10.2\" audit --production","tests-only":"nyc tape 'test/**/*.js'","prelint":"evalmd README.md","lint":"eslint --ext=js,mjs .","postlint":"es-shim-api --bound","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"repository":{"type":"git","url":"git://github.com/es-shims/array-includes.git"},"keywords":["Array.prototype.includes","includes","array","ES7","shim","polyfill","contains","Array.prototype.contains","es-shim API"],"dependencies":{"call-bind":"^1.0.8","call-bound":"^1.0.4","define-properties":"^1.2.1","es-abstract":"^1.24.0","es-object-atoms":"^1.1.1","get-intrinsic":"^1.3.0","is-string":"^1.1.1","math-intrinsics":"^1.1.0"},"devDependencies":{"@es-shims/api":"^2.5.1","@ljharb/eslint-config":"^21.1.1","auto-changelog":"^2.5.0","encoding":"^0.1.13","eslint":"=8.8.0","evalmd":"^0.0.19","functions-have-names":"^1.2.3","has-strict-mode":"^1.1.0","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.9.0"},"testling":{"files":["test/index.js","test/implementation.js","test/shimmed.js"],"browsers":["iexplore/6.0..latest","firefox/3.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/10.0..latest","opera/next","safari/4.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"3.1.6"},"publishConfig":{"ignore":[".github/workflows"]},"_id":"array-includes@3.1.9","gitHead":"afad86453393b4bde08e2ce692909078d5bccefa","bugs":{"url":"https://github.com/es-shims/array-includes/issues"},"homepage":"https://github.com/es-shims/array-includes#readme","_nodeVersion":"24.1.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==","shasum":"1f0ccaa08e90cdbc3eb433210f903ad0f17c3f3a","tarball":"http://registry-npm.ywwl.com/array-includes/download/array-includes-3.1.9.tgz","fileCount":17,"unpackedSize":27327,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDryaPBI38cvNXT6arNRQQw4Vp47a8LpgWvA8nTrGgRqAIhAPM2qy++rVdLuxS/x2TejU5CXMdiHnBP9nXPIlqV5Coy"}],"size":9115,"noattachment":false,"key":"/array-includes/-/array-includes-3.1.9.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/array-includes_3.1.9_1748840480784_0.5529761132026192"},"_hasShrinkwrap":false,"readme":"# array-includes <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](https://262.ecma-international.org/6.0/).\n\nBecause `Array.prototype.includes` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument.\n\nEngines that need this package include:\n - IE (all versions)\n - Safari < 9\n - Firefox < 43, and 99-101\n - Chrome < 47\n - Edge < 14\n - node < 6\n\n## Getting started\n\n```sh\nnpm install --save array-includes\n```\n\n## Usage\n\nBasic usage: **includes(array, value[, fromIndex=0])**\n\n```js\nvar includes = require('array-includes');\nvar assert = require('assert');\nvar arr = [ 'one', 'two' ];\n\nincludes(arr, 'one'); // true\nincludes(arr, 'three'); // false\nincludes(arr, 'one', 1); // false\n```\n\n\n\n## Example\n\n```js\nvar arr = [\n\t1,\n\t'foo',\n\tNaN,\n\t-0\n];\n\nassert.equal(arr.indexOf(0) > -1, true);\nassert.equal(arr.indexOf(-0) > -1, true);\nassert.equal(includes(arr, 0), true);\nassert.equal(includes(arr, -0), true);\n\nassert.equal(arr.indexOf(NaN) > -1, false);\nassert.equal(includes(arr, NaN), true);\n\nassert.equal(includes(arr, 'foo', 0), true);\nassert.equal(includes(arr, 'foo', 1), true);\nassert.equal(includes(arr, 'foo', 2), false);\n```\n\n```js\n/* when Array#includes is not present */\ndelete Array.prototype.includes;\nvar shimmedIncludes = includes.shim();\n\nassert.equal(shimmedIncludes, includes.getPolyfill());\nassert.equal(arr.includes('foo', 1), includes(arr, 'foo', 1));\n```\n\n```js\n/* when Array#includes is present */\nvar shimmedIncludes = includes.shim();\n\nassert.equal(shimmedIncludes, Array.prototype.includes);\nassert.equal(arr.includes(1, 'foo'), includes(arr, 1, 'foo'));\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/array-includes\n[npm-version-svg]: https://versionbadg.es/es-shims/array-includes.svg\n[deps-svg]: https://david-dm.org/es-shims/array-includes.svg\n[deps-url]: https://david-dm.org/es-shims/array-includes\n[dev-deps-svg]: https://david-dm.org/es-shims/array-includes/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/array-includes#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/array-includes.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/array-includes.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/array-includes.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=array-includes\n[codecov-image]: https://codecov.io/gh/es-shims/array-includes/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/array-includes/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/array-includes\n[actions-url]: https://github.com/es-shims/array-includes/actions\n","publish_time":1748840480983,"_cnpm_publish_time":1748840480983,"dist-tags":{"latest":"3.2.0"}}