Update metadata.mjs

This commit is contained in:
lowlighter
2021-02-10 00:14:36 +01:00
parent 3cbd3fd811
commit d784073d61

View File

@@ -60,8 +60,9 @@
if (!account) if (!account)
logger(`metrics/inputs > account type not set for plugin ${name}!`) logger(`metrics/inputs > account type not set for plugin ${name}!`)
if (account !== "bypass") { if (account !== "bypass") {
if (!meta.supports?.includes(q.repo ? "repository" : account)) const context = q.repo ? "repository" : account
throw {error:{message:`Not supported for: ${account}`, instance:new Error()}} if (!meta.supports?.includes(context))
throw {error:{message:`Not supported for: ${context}`, instance:new Error()}}
} }
//Inputs checks //Inputs checks
const result = Object.fromEntries(Object.entries(inputs).map(([key, {type, format, default:defaulted, min, max, values}]) => [ const result = Object.fromEntries(Object.entries(inputs).map(([key, {type, format, default:defaulted, min, max, values}]) => [