UNPKG

rete-kit

Version:

Rete.js Kit ==== [![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua) [![Discord](https://img.shields.io/discord/1081223198055604244?color=%237289da&label=Discord)](https://disco

23 lines (22 loc) 839 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PrefixedHeadingTransformer = void 0; /** * Transformer that adds a first-level heading with optional prefix * Can be used for both single-file and multi-file strategies */ class PrefixedHeadingTransformer { constructor(instruction, prefix) { this.instruction = instruction; this.prefix = prefix; } transform(content) { // Add first-level heading with prefix and instruction title const title = this.instruction.title || this.instruction.file.split('/').pop() || this.instruction.file; const heading = this.prefix ? `# ${this.prefix} ${title}` : `# ${title}`; return `${heading}\n\n${content}`; } } exports.PrefixedHeadingTransformer = PrefixedHeadingTransformer;