continue-custom/core/tools/systemMessageTools/systemToolUtils.ts
2025-07-20 10:52:22 +02:00

17 lines
508 B
TypeScript

export function closeTag(openingTag: string): string {
return `</${openingTag.slice(1)}`;
}
export function getStringDelta(original: string, updated: string): string {
if (!updated.startsWith(original)) {
console.warn(
`Original string "${original}" is not a prefix of updated string "${updated}"`,
);
return updated;
}
return updated.slice(original.length);
}
export function splitAtCodeblocksAndNewLines(content: string) {
return content.split(/(```|\n)/g).filter(Boolean);
}