24 lines
648 B
TypeScript
24 lines
648 B
TypeScript
// Metro module 13559 (f13560).
|
|
import { RPC_SCOPE_CONFIG } from "../Constants";
|
|
export default function validateScope(a0, a1) {
|
|
if (a1 == null) {
|
|
return true;
|
|
}
|
|
if (typeof a1 === "string") {
|
|
return a0.includes(a1);
|
|
}
|
|
if (typeof a1 !== "object") {
|
|
return false;
|
|
}
|
|
const r10 = a1[RPC_SCOPE_CONFIG.ANY];
|
|
const r13 = a1[RPC_SCOPE_CONFIG.ALL];
|
|
const isArray = Array.isArray(r10);
|
|
const r0 = isArray ? !r10.some((item) => a0.includes(item)) : !isArray;
|
|
let r19 = !r0;
|
|
if (r0) {
|
|
const isArray2 = Array.isArray(r13);
|
|
r19 = !(isArray2 ? !r13.every((item) => a0.includes(item)) : !isArray2);
|
|
}
|
|
return r19;
|
|
};
|