"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SanitizeCodeBlock = SanitizeCodeBlock;
const class_transformer_1 = require("class-transformer");
function SanitizeCodeBlock() {
    return (0, class_transformer_1.Transform)(({ value }) => {
        if (typeof value !== 'string') {
            return value;
        }
        const trimmedValue = value.trim();
        const codeMatch = trimmedValue.match(/^```(?:\w*\n)?([\s\S]*)```$/);
        return codeMatch ? codeMatch[1].trim() : trimmedValue;
    });
}
//# sourceMappingURL=sanitizer.decorator.js.map