decord/source/628_isIndex.js

37 lines
652 B
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 628
// Function ID: 629
// Name: isIndex
// Dependencies: []
// Module 628 (isIndex)
const re0 = /^(?:0|[1-9]\d*)$/;
2026-08-04 21:03:28 +00:00
export default function isIndex(num) {
num = 9007199254740991;
2026-07-29 08:29:29 +00:00
if (null != arg1) {
num = arg1;
}
let tmp = num;
if (tmp) {
2026-08-04 21:03:28 +00:00
let tmp2 = typeof num === "number";
if (typeof num !== "number") {
let isMatch = typeof num !== "symbol";
if (typeof num !== "symbol") {
isMatch = regex.test(num);
2026-07-29 08:29:29 +00:00
}
tmp2 = isMatch;
}
tmp = tmp2;
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = num > -1;
2026-07-29 08:29:29 +00:00
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = num % 1 === 0;
2026-07-29 08:29:29 +00:00
}
if (tmp) {
2026-08-04 21:03:28 +00:00
tmp = num < num;
2026-07-29 08:29:29 +00:00
}
return tmp;
};