decord/alpha/source/modules/rpc/helpers/validateScope.tsx

42 lines
1 KiB
TypeScript
Raw Normal View History

// Module ID: 14273
// Function ID: 14274
2026-07-20 16:05:17 +00:00
// Name: validateScope
// Dependencies: [5270, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 14273 (validateScope)
import Constants from "Constants" /* 5270 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const RPC_SCOPE_CONFIG = Constants.RPC_SCOPE_CONFIG;
const result = size.fileFinishedImporting("modules/rpc/helpers/validateScope.tsx");
2026-07-20 16:05:17 +00:00
2026-08-04 21:03:28 +00:00
export default function validateScope(arr, str) {
closure_0 = arr;
2026-08-04 21:03:28 +00:00
if (null == str) {
2026-07-20 16:05:17 +00:00
return true;
2026-08-04 21:03:28 +00:00
} else if (typeof str === "string") {
return arr.includes(str);
} else if (typeof str !== "object") {
2026-07-20 16:05:17 +00:00
return false;
} else {
const _Array2 = Array;
2026-07-29 08:29:29 +00:00
const isArray = Array.isArray(obj);
let tmp = !isArray;
if (isArray) {
tmp = !obj.some((item) => closure_0.includes(item));
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
let tmp2 = !tmp;
if (tmp) {
const _Array = Array;
2026-07-29 08:29:29 +00:00
const isArray1 = Array.isArray(obj2);
let tmp4 = !isArray1;
if (isArray1) {
tmp4 = !obj2.every((item) => closure_0.includes(item));
2026-07-29 08:29:29 +00:00
}
tmp2 = !tmp4;
2026-07-20 16:05:17 +00:00
}
return tmp2;
}
};