array-includes
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -0,1 +1,12 @@ | ||
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 | ||
@@ -2,0 +13,0 @@ ================= |
'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/2021/ToIntegerOrInfinity'); | ||
var ToLength = require('es-abstract/2021/ToLength'); | ||
var ToObject = require('es-abstract/2021/ToObject'); | ||
var SameValueZero = require('es-abstract/2021/SameValueZero'); | ||
var $isNaN = require('es-abstract/helpers/isNaN'); | ||
@@ -15,5 +15,6 @@ var $isFinite = require('es-abstract/helpers/isFinite'); | ||
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') { | ||
@@ -28,3 +29,3 @@ return $indexOf.apply(this, arguments) > -1; | ||
} | ||
var k = fromIndex >= 0 ? fromIndex : Math.max(0, length + fromIndex); | ||
var k = fromIndex >= 0 ? fromIndex : $max(0, length + fromIndex); | ||
while (k < length) { | ||
@@ -31,0 +32,0 @@ if (SameValueZero(searchElement, isString(O) ? $charAt(O, k) : O[k])) { |
'use strict'; | ||
var define = require('define-properties'); | ||
var RequireObjectCoercible = require('es-abstract/2020/RequireObjectCoercible'); | ||
var RequireObjectCoercible = require('es-abstract/2021/RequireObjectCoercible'); | ||
var callBind = require('call-bind'); | ||
@@ -6,0 +6,0 @@ var callBound = require('call-bind/callBound'); |
{ | ||
"name": "array-includes", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"author": { | ||
@@ -23,3 +23,4 @@ "name": "Jordan Harband", | ||
"scripts": { | ||
"prepublish": "safe-publish-latest", | ||
"prepublish": "not-in-publish || npm run prepublishOnly", | ||
"prepublishOnly": "safe-publish-latest", | ||
"pretest": "npm run --silent lint && evalmd README.md", | ||
@@ -50,12 +51,12 @@ "test": "npm run --silent tests-only", | ||
"define-properties": "^1.1.3", | ||
"es-abstract": "^1.18.0-next.2", | ||
"es-abstract": "^1.19.1", | ||
"get-intrinsic": "^1.1.1", | ||
"is-string": "^1.0.5" | ||
"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", | ||
"@es-shims/api": "^2.2.2", | ||
"@ljharb/eslint-config": "^18.0.0", | ||
"aud": "^1.1.5", | ||
"eslint": "^7.32.0", | ||
"evalmd": "^0.0.19", | ||
"foreach": "^2.0.5", | ||
@@ -68,3 +69,3 @@ "function-bind": "^1.1.1", | ||
"safe-publish-latest": "^1.1.4", | ||
"tape": "^5.2.0" | ||
"tape": "^5.3.1" | ||
}, | ||
@@ -71,0 +72,0 @@ "testling": { |
# 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] | ||
@@ -13,3 +14,3 @@ [![dev dependency status][dev-deps-svg]][dev-deps-url] | ||
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/). | ||
@@ -84,5 +85,3 @@ Because `Array.prototype.includes` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument. | ||
[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 | ||
@@ -93,5 +92,9 @@ [deps-url]: https://david-dm.org/es-shims/array-includes | ||
[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 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22369
204
98
0
Updatedes-abstract@^1.19.1
Updatedis-string@^1.0.7