nrs 0d1da61d14
[draft] takt/284/implement-using-only-the-files (#296)
* feat: track project-level .takt/pieces in version control

* feat: track project-level takt facets for customizable resources

* chore: include project .takt/config.yaml in git-tracked subset

* takt: github-issue-284-faceted-prompting
2026-02-18 23:21:09 +09:00

17 lines
484 B
TypeScript

/**
* Template injection prevention.
*
* Escapes curly braces in dynamic content so they are not
* interpreted as template variables by the template engine.
*
* This module has ZERO dependencies on TAKT internals.
*/
/**
* Replace ASCII curly braces with full-width equivalents
* to prevent template variable injection in user-supplied content.
*/
export function escapeTemplateChars(str: string): string {
return str.replace(/\{/g, '\uff5b').replace(/\}/g, '\uff5d');
}