persona-community-5/.pnpm-store/v3/files/08/a85494e7c81e3bb8a746b4533a66eaf3b5360f98dd0abafd55e8f22c0ae509d789f2f083413b465a66bcc3490696b12830d3bceb7cf8a349765e59eff1349d
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

63 lines
2.2 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecComponentsInvalidMapName = void 0;
const SpecComponentsInvalidMapName = () => {
const KEYS_REGEX = '^[a-zA-Z0-9\\.\\-_]+$';
function validateKey(key, report, location, component) {
if (!new RegExp(KEYS_REGEX).test(key)) {
report({
message: `The map key in ${component} "${key}" does not match the regular expression "${KEYS_REGEX}"`,
location: location.key(),
});
}
}
return {
NamedSchemas: {
Schema(_node, { key, report, location }) {
validateKey(key, report, location, 'schemas');
},
},
NamedParameters: {
Parameter(_node, { key, report, location }) {
validateKey(key, report, location, 'parameters');
},
},
NamedResponses: {
Response(_node, { key, report, location }) {
validateKey(key, report, location, 'responses');
},
},
NamedExamples: {
Example(_node, { key, report, location }) {
validateKey(key, report, location, 'examples');
},
},
NamedRequestBodies: {
RequestBody(_node, { key, report, location }) {
validateKey(key, report, location, 'requestBodies');
},
},
NamedHeaders: {
Header(_node, { key, report, location }) {
validateKey(key, report, location, 'headers');
},
},
NamedSecuritySchemes: {
SecurityScheme(_node, { key, report, location }) {
validateKey(key, report, location, 'securitySchemes');
},
},
NamedLinks: {
Link(_node, { key, report, location }) {
validateKey(key, report, location, 'links');
},
},
NamedCallbacks: {
Callback(_node, { key, report, location }) {
validateKey(key, report, location, 'callbacks');
},
},
};
};
exports.SpecComponentsInvalidMapName = SpecComponentsInvalidMapName;