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

30 lines
1.2 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperationDescriptionOverride = void 0;
const utils_1 = require("../../utils");
const OperationDescriptionOverride = ({ operationIds }) => {
return {
Operation: {
leave(operation, { report, location }) {
if (!operation.operationId)
return;
if (!operationIds)
throw new Error(`Parameter "operationIds" is not provided for "operation-description-override" rule`);
const operationId = operation.operationId;
if (operationIds[operationId]) {
try {
operation.description = (0, utils_1.readFileAsStringSync)(operationIds[operationId]);
}
catch (e) {
report({
message: `Failed to read markdown override file for operation "${operationId}".\n${e.message}`,
location: location.child('operationId').key(),
});
}
}
},
},
};
};
exports.OperationDescriptionOverride = OperationDescriptionOverride;