Permalink
Cannot retrieve contributors at this time
25 lines (21 sloc)
759 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/_isIndex.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Used as references for various `Number` constants. */ | |
var MAX_SAFE_INTEGER = 9007199254740991; | |
/** Used to detect unsigned integer values. */ | |
var reIsUint = /^(?:0|[1-9]\d*)$/; | |
/** | |
* Checks if `value` is a valid array-like index. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. | |
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`. | |
*/ | |
function isIndex(value, length) { | |
var type = typeof value; | |
length = length == null ? MAX_SAFE_INTEGER : length; | |
return !!length && | |
(type == 'number' || | |
(type != 'symbol' && reIsUint.test(value))) && | |
(value > -1 && value % 1 == 0 && value < length); | |
} | |
module.exports = isIndex; |