MCPcopy Index your code
hub / github.com/simstudioai/sim / intersectAllowlists

Function intersectAllowlists

apps/sim/hooks/use-permission-config.ts:63–67  ·  view source on GitHub ↗

* Intersects two allowlists. If either is null (unrestricted), returns the other. * If both are set, returns only items present in both.

(a: string[] | null, b: string[] | null)

Source from the content-addressed store, hash-verified

61 * If both are set, returns only items present in both.
62 */
63function intersectAllowlists(a: string[] | null, b: string[] | null): string[] | null {
64 if (a === null) return b
65 if (b === null) return a.map((i) => i.toLowerCase())
66 return a.map((i) => i.toLowerCase()).filter((i) => b.includes(i))
67}
68
69export function usePermissionConfig(): PermissionConfigResult {
70 const params = useParams()

Callers 1

usePermissionConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected