Skip to content

interpolateText()

PromptScript API


interpolateText(text, ctx): string

Defined in: core/src/template.ts:228

Interpolate template variables in a text string.

Parameters

text

string

Text containing {{variable}} placeholders

ctx

TemplateContext

Template context with bound parameters

Returns

string

Interpolated text

Throws

UndefinedVariableError if a variable is used but not defined