Files
codeql-action/node_modules/es-abstract/2021/IsValidIntegerIndex.js
dependabot[bot] e7e35baaf0 Bump the npm group with 2 updates (#1819)
* Bump the npm group with 2 updates

Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import).


Updates `eslint` from 8.45.0 to 8.46.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.0)

Updates `eslint-plugin-import` from 2.27.5 to 2.28.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.28.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-01 03:35:02 -07:00

34 lines
935 B
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var IsIntegralNumber = require('./IsIntegralNumber');
var isNegativeZero = require('../helpers/isNegativeZero');
var typedArrayBuffer = require('typed-array-buffer');
// https://262.ecma-international.org/12.0/#sec-isvalidintegerindex
module.exports = function IsValidIntegerIndex(O, index) {
// Assert: O is an Integer-Indexed exotic object.
var buffer = typedArrayBuffer(O); // step 1
if (typeof index !== 'number') {
throw new $TypeError('Assertion failed: Type(index) is not Number');
}
if (IsDetachedBuffer(buffer)) { return false; } // step 2
if (!IsIntegralNumber(index)) { return false; } // step 3
if (isNegativeZero(index)) { return false; } // step 4
if (index < 0 || index >= O.length) { return false; } // step 5
return true; // step 6
};