EASYAIuniappNewUI/node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_isIndex.ts
2025-02-08 18:50:38 +08:00

13 lines
312 B
TypeScript

import { MAX_SAFE_INTEGER, reIsUint } from './_common'
export function isIndex(value: any, length?: any) {
length = length == null ? MAX_SAFE_INTEGER : length
return (
!!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
value > -1 &&
value % 1 == 0 &&
value < length
)
}