* 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)
| 610 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. |
| 611 | */ |
| 612 | function isIndex(value, length) { |
| 613 | length = length == null ? MAX_SAFE_INTEGER : length; |
| 614 | return ( |
| 615 | !!length && |
| 616 | (typeof value == 'number' || reIsUint.test(value)) && |
| 617 | value > -1 && |
| 618 | value % 1 == 0 && |
| 619 | value < length |
| 620 | ); |
| 621 | } |
| 622 | |
| 623 | /** |
| 624 | * Checks if `value` is a property name and not a property path. |
no outgoing calls
no test coverage detected
searching dependent graphs…