Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152//region Answer normalization
/** Removes one editor-added final line ending while preserving every other character. @param text - raw UTF-8 editor text @returns text without at most one final LF or CRLF @example ```ts normalizeEditorAnswer({ text: 'first\nsecond\n' }); ``` */export function normalizeEditorAnswer( { text, }: { readonly text: string; },): string { if (text.endsWith('\r\n',)) return text.slice( 0, -2, ); if (text.endsWith('\n',)) return text.slice( 0, -1, ); return text;}
/** Determines whether normalized editor content carries no visible answer. @param text - normalized editor text @returns whether text contains only whitespace @example ```ts isBlankAnswer({ text: ' \n' }); ``` */export function isBlankAnswer( { text, }: { readonly text: string; },): boolean { return text.trim() .length === 0;}
//endregion Answer normalization