Files
NapCatQQ/.pnpm-store/v3/files/39/762f2f71e7820bbeb240bdbaf6dcaed9c630cfdfe601f82f7d627d71c4a519d8bea5b2e372b3a21943041c38455fd25225c173173a19a41007cdb70eef9392
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

26 lines
567 B
Plaintext

import { Block, Tokens } from '../primitives.js';
export type Stringifier = (block: Block) => string;
function join(tokens: Tokens): string {
return (
tokens.start +
tokens.delimiter +
tokens.postDelimiter +
tokens.tag +
tokens.postTag +
tokens.type +
tokens.postType +
tokens.name +
tokens.postName +
tokens.description +
tokens.end +
tokens.lineEnd
);
}
export default function getStringifier(): Stringifier {
return (block: Block): string =>
block.source.map(({ tokens }) => join(tokens)).join('\n');
}