Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
//#region src/compat/_internal/isIndex.ts
const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
switch (typeof value) {
case "number": return Number.isInteger(value) && value >= 0 && value < length;
case "symbol": return false;
case "string": return IS_UNSIGNED_INTEGER.test(value);
}
}
//#endregion
export { isIndex };