clean-jsdoc-theme TypeDoc APIv0.0.0

interpolate

interpolate( template: string, values: Record<string, unknown>, ): string

Source: string.ts:380

String template interpolation

Parameters

  • template (string) — Template string with placeholders
  • values (Record<string, unknown>) — Object with replacement values

Returns

  • string — Interpolated string

Example

CODE
interpolate('Hello, {name}!', { name: 'World' }) // 'Hello, World!'
interpolate('{a} + {b} = {c}', { a: 1, b: 2, c: 3 }) // '1 + 2 = 3'