UNPKG

hd-utils

Version:

A handy utils for modern JS developers

10 lines (9 loc) 377 B
import { Key } from '../types'; /** * @description Checks if `value` is a valid array-like index. * * @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`. */ export default function isIndex(value: Key, length?: number): boolean;