(policy)
| 31 | ]); |
| 32 | |
| 33 | function 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 | |
| 53 | function isNonEmptyString(value) { |
| 54 | return typeof value === "string" && value.trim().length > 0; |
no outgoing calls
no test coverage detected