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

40 lines
996 B
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 13767
// Function ID: 13768
2026-07-20 16:05:17 +00:00
// Name: validateScope
2026-08-08 06:10:11 +00:00
// Dependencies: [4206, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-08 06:10:11 +00:00
// Module 13767 (validateScope)
2026-07-23 10:11:24 +00:00
import { RPC_SCOPE_CONFIG } from "RPC_SCOPE_CONFIG";
const result = require("set").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) {
2026-07-20 16:05:17 +00:00
const RPC_SCOPE_CONFIG = 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((arg0) => arr.includes(arg0));
}
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((arg0) => arr.includes(arg0));
}
tmp2 = !tmp4;
2026-07-20 16:05:17 +00:00
}
return tmp2;
}
};