persona-community-5/.pnpm-store/v3/files/b9/ba0507d3a8e7fb03ff9e80637790af17b1189fa95c48de89611820ad7c0e4dbec44b35f68b0c7f914988a8ead3d294fef2a236a0f552da85da33650a04a06d
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

32 lines
1.4 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NoUndefinedServerVariable = void 0;
const NoUndefinedServerVariable = () => {
return {
Server(server, { report, location }) {
if (!server.url)
return;
const urlVariables = server.url.match(/{[^}]+}/g)?.map((e) => e.slice(1, e.length - 1)) || [];
const definedVariables = (server?.variables && Object.keys(server.variables)) || [];
for (const serverVar of urlVariables) {
if (!definedVariables.includes(serverVar)) {
report({
message: `The \`${serverVar}\` variable is not defined in the \`variables\` objects.`,
location: location.child(['url']),
});
}
}
for (const definedServerVar of definedVariables) {
if (!urlVariables.includes(definedServerVar)) {
report({
message: `The \`${definedServerVar}\` variable is not used in the server's \`url\` field.`,
location: location.child(['variables', definedServerVar]).key(),
from: location.child('url'),
});
}
}
},
};
};
exports.NoUndefinedServerVariable = NoUndefinedServerVariable;