Skip to content

Template

Defined in: packages/pythonlib/src/string.ts:50

Constructors

Constructor

new Template(template: string): Template

Defined in: packages/pythonlib/src/string.ts:53

Parameters

ParameterType
templatestring

Returns

Template

Properties

template

readonly template: string

Defined in: packages/pythonlib/src/string.ts:51

Methods

getIdentifiers()

getIdentifiers(): string[]

Defined in: packages/pythonlib/src/string.ts:90

Get identifiers in template

Returns

string[]


safeSubstitute()

safeSubstitute(mapping?: Record<string, unknown>): string

Defined in: packages/pythonlib/src/string.ts:74

Perform substitution, returning original placeholder for missing keys

Parameters

ParameterType
mapping?Record<string, unknown>

Returns

string


substitute()

substitute(mapping?: Record<string, unknown>): string

Defined in: packages/pythonlib/src/string.ts:58

Perform substitution, raising KeyError for missing keys

Parameters

ParameterType
mapping?Record<string, unknown>

Returns

string