* 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`.
(value, length)
| 540 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. |
| 541 | */ |
| 542 | function isIndex(value, length) { |
| 543 | length = length == null ? MAX_SAFE_INTEGER : length; |
| 544 | return ( |
| 545 | !!length && |
| 546 | (typeof value === "number" || reIsUint.test(value)) && |
| 547 | (value > -1 && value % 1 === 0 && value < length) |
| 548 | ); |
| 549 | } |
| 550 | |
| 551 | /** |
| 552 | * Checks if `func` has its source masked. |