MCPcopy Index your code
hub / github.com/nodejs/node / isArrayIndex

Function isArrayIndex

lib/internal/modules/esm/resolve.js:463–467  ·  view source on GitHub ↗

* Checks if the given key is a valid array index. * @param {string} key - The key to check. * @returns {boolean} - Returns `true` if the key is a valid array index, else `false`.

(key)

Source from the content-addressed store, hash-verified

461 * @returns {boolean} - Returns `true` if the key is a valid array index, else `false`.
462 */
463function isArrayIndex(key) {
464 const keyNum = +key;
465 if (`${keyNum}` !== key) { return false; }
466 return keyNum >= 0 && keyNum < 0xFFFF_FFFF;
467}
468
469/**
470 * Resolves the target of a package based on the provided parameters.

Callers 1

resolvePackageTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…