* 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
17 lines
484 B
TypeScript
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');
|
|
}
|