Bump eslint-plugin-import to avoid vulnerability in dependency

This commit is contained in:
Henry Mercer 2023-01-18 20:26:59 +00:00
parent 10695e6a20
commit ed9506bbaf
1660 changed files with 67726 additions and 27926 deletions

View file

@ -1 +0,0 @@
coverage/

View file

@ -4,10 +4,17 @@
"extends": "@ljharb",
"rules": {
"complexity": 0,
"id-length": [2, { "min": 1, "max": 26 }],
"max-statements": [2, 14],
"new-cap": [2, { capIsNewExceptions: ["GetIntrinsic", "ToObject", "ToInteger", "ToLength", "SameValueZero", "RequireObjectCoercible"] }],
"new-cap": [2, {
"capIsNewExceptions": [
"GetIntrinsic",
"ToObject",
"ToIntegerOrInfinity",
"ToLength",
"SameValueZero",
"RequireObjectCoercible",
],
}],
},
"overrides": [

4
node_modules/array-includes/.nycrc generated vendored
View file

@ -2,10 +2,6 @@
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"test"

View file

@ -1,3 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v3.1.6](https://github.com/es-shims/array-includes/compare/v3.1.5...v3.1.6) - 2022-11-07
### Commits
- [meta] add `auto-changelog` [`c5fbe72`](https://github.com/es-shims/array-includes/commit/c5fbe728395deff641d756cc9d398a949076c180)
- [meta] use `npmignore` to autogenerate an npmignore file [`dbd6dc8`](https://github.com/es-shims/array-includes/commit/dbd6dc8f8906cca6b0b493e308686c4fd05bea15)
- [Deps] update `es-abstract`, `get-intrinsic` [`b819e3b`](https://github.com/es-shims/array-includes/commit/b819e3b3dd1adce0b3359529b0276a416efce351)
- [actions] update rebase action to use reusable workflow [`6e241d5`](https://github.com/es-shims/array-includes/commit/6e241d5177513cfb0261d0fbe0c8c98daf5c5eab)
- [Dev Deps] update `aud`, `tape` [`9b2a931`](https://github.com/es-shims/array-includes/commit/9b2a931aee6fc8195a349c6fe7894445a911223f)
- [readme] note that FF 102+ no longer needs this package [`0a0c758`](https://github.com/es-shims/array-includes/commit/0a0c758ed52808428314ffe53ea8278297170c84)
<!-- auto-changelog-above -->
3.1.5 / 2022-05-03
=================
* [Fix] install polyfill on FF 99+
* [Deps] update `define-properties`, `es-abstract`
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `functions-have-names`, `safe-publish-latest`, `tape`
* [actions] reuse common workflows
* [actions] update codecov uploader
3.1.4 / 2021-10-04
=================
* [Robustness] avoid a runtime `Math.max` call
* [readme] add github actions/codecov badges
* [readme] fix repo URLs; remove travis badge
* [Deps] update `es-abstract`, `is-string`
* [meta] use `prepublishOnly` script for npm 7+
* [actions] update workflows
* [actions] use `node/install` instead of `node/run`; use `codecov` action
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `tape`
3.1.3 / 2021-02-20
=================
* [Deps] update `call-bind`, `es-abstract`, `get-intrinsic`

View file

@ -1,6 +1,7 @@
# array-includes <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![Build Status][travis-svg]][travis-url]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
@ -10,10 +11,18 @@
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](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](http://www.ecma-international.org/ecma-262/6.0/).
This 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/).
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
```sh
@ -80,15 +89,17 @@ assert.equal(arr.includes(1, 'foo'), includes(arr, 1, 'foo'));
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/array-includes
[npm-version-svg]: http://versionbadg.es/es-shims/array-includes.svg
[travis-svg]: https://travis-ci.org/es-shims/array-includes.svg
[travis-url]: https://travis-ci.org/es-shims/array-includes
[npm-version-svg]: https://versionbadg.es/es-shims/array-includes.svg
[deps-svg]: https://david-dm.org/es-shims/array-includes.svg
[deps-url]: https://david-dm.org/es-shims/array-includes
[dev-deps-svg]: https://david-dm.org/es-shims/array-includes/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/array-includes#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/array-includes.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/array-includes.svg
[license-image]: https://img.shields.io/npm/l/array-includes.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/array-includes.svg
[downloads-url]: http://npm-stat.com/charts.html?package=array-includes
[downloads-image]: https://img.shields.io/npm/dm/array-includes.svg
[downloads-url]: https://npm-stat.com/charts.html?package=array-includes
[codecov-image]: https://codecov.io/gh/es-shims/array-includes/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/array-includes/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/array-includes
[actions-url]: https://github.com/es-shims/array-includes/actions

View file

@ -1,9 +1,9 @@
'use strict';
var ToInteger = require('es-abstract/2020/ToInteger');
var ToLength = require('es-abstract/2020/ToLength');
var ToObject = require('es-abstract/2020/ToObject');
var SameValueZero = require('es-abstract/2020/SameValueZero');
var ToIntegerOrInfinity = require('es-abstract/2022/ToIntegerOrInfinity');
var ToLength = require('es-abstract/2022/ToLength');
var ToObject = require('es-abstract/2022/ToObject');
var SameValueZero = require('es-abstract/2022/SameValueZero');
var $isNaN = require('es-abstract/helpers/isNaN');
var $isFinite = require('es-abstract/helpers/isFinite');
var GetIntrinsic = require('get-intrinsic');
@ -12,9 +12,10 @@ var isString = require('is-string');
var $charAt = callBound('String.prototype.charAt');
var $indexOf = GetIntrinsic('%Array.prototype.indexOf%'); // TODO: use callBind.apply without breaking IE 8
var $max = GetIntrinsic('%Math.max%');
module.exports = function includes(searchElement) {
var fromIndex = arguments.length > 1 ? ToInteger(arguments[1]) : 0;
var fromIndex = arguments.length > 1 ? ToIntegerOrInfinity(arguments[1]) : 0;
if ($indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') {
return $indexOf.apply(this, arguments) > -1;
}
@ -24,7 +25,7 @@ module.exports = function includes(searchElement) {
if (length === 0) {
return false;
}
var k = fromIndex >= 0 ? fromIndex : Math.max(0, length + fromIndex);
var k = fromIndex >= 0 ? fromIndex : $max(0, length + fromIndex);
while (k < length) {
if (SameValueZero(searchElement, isString(O) ? $charAt(O, k) : O[k])) {
return true;

View file

@ -1,7 +1,7 @@
'use strict';
var define = require('define-properties');
var RequireObjectCoercible = require('es-abstract/2020/RequireObjectCoercible');
var RequireObjectCoercible = require('es-abstract/2022/RequireObjectCoercible');
var callBind = require('call-bind');
var callBound = require('call-bind/callBound');

View file

@ -1,6 +1,6 @@
{
"name": "array-includes",
"version": "3.1.3",
"version": "3.1.6",
"author": {
"name": "Jordan Harband",
"email": "ljharb@gmail.com",
@ -20,13 +20,18 @@
"license": "MIT",
"main": "index.js",
"scripts": {
"prepublish": "safe-publish-latest",
"pretest": "npm run --silent lint && evalmd README.md",
"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 aud --production",
"posttest": "aud --production",
"tests-only": "nyc tape 'test/**/*.js'",
"lint": "eslint .",
"postlint": "es-shim-api --bound"
"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",
@ -45,25 +50,27 @@
],
"dependencies": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.2",
"get-intrinsic": "^1.1.1",
"is-string": "^1.0.5"
"define-properties": "^1.1.4",
"es-abstract": "^1.20.4",
"get-intrinsic": "^1.1.3",
"is-string": "^1.0.7"
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^17.5.1",
"aud": "^1.1.4",
"eslint": "^7.20.0",
"evalmd": "0.0.19",
"foreach": "^2.0.5",
"@es-shims/api": "^2.2.3",
"@ljharb/eslint-config": "^21.0.0",
"aud": "^2.0.1",
"auto-changelog": "^2.4.0",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"function-bind": "^1.1.1",
"functions-have-names": "^1.2.2",
"functions-have-names": "^1.2.3",
"has-strict-mode": "^1.0.1",
"in-publish": "^2.0.1",
"indexof": "^0.0.1",
"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"tape": "^5.2.0"
"safe-publish-latest": "^2.0.0",
"tape": "^5.6.1"
},
"testling": {
"files": [
@ -89,5 +96,19 @@
},
"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"
]
}
}

View file

@ -3,5 +3,11 @@
var implementation = require('./implementation');
module.exports = function getPolyfill() {
return Array.prototype.includes || implementation;
if (
Array.prototype.includes
&& Array(1).includes(undefined) // https://bugzilla.mozilla.org/show_bug.cgi?id=1767541
) {
return Array.prototype.includes;
}
return implementation;
};

View file

@ -1,5 +1,7 @@
'use strict';
var orig = Array.prototype.includes;
require('../auto');
var test = require('tape');
@ -11,6 +13,7 @@ var functionsHaveNames = require('functions-have-names')();
var runTests = require('./tests');
test('shimmed', function (t) {
t.comment('shimmed: ' + (orig === Array.prototype.includes ? 'no' : 'yes'));
t.equal(Array.prototype.includes.length, 1, 'Array#includes has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Array.prototype.includes.name, 'includes', 'Array#includes has name "includes"');