MCPcopy Create free account
hub / github.com/github/awesome-copilot / resolvePolicy

Function resolvePolicy

eng/external-plugin-validation.mjs:33–51  ·  view source on GitHub ↗
(policy)

Source from the content-addressed store, hash-verified

31]);
32
33function resolvePolicy(policy) {
34 if (!policy) {
35 return EXTERNAL_PLUGIN_POLICIES.marketplace;
36 }
37
38 if (typeof policy === "string") {
39 const resolved = EXTERNAL_PLUGIN_POLICIES[policy];
40 if (!resolved) {
41 throw new Error(`Unknown external plugin validation policy "${policy}"`);
42 }
43
44 return resolved;
45 }
46
47 return {
48 ...EXTERNAL_PLUGIN_POLICIES.marketplace,
49 ...policy,
50 };
51}
52
53function isNonEmptyString(value) {
54 return typeof value === "string" && value.trim().length > 0;

Callers 2

validateExternalPluginFunction · 0.85
validateExternalPluginsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected