Replacement Options

interface ReplaceOptions {
    keyPattern?: string;
    keyPatternFlags?: string;
    keyPostfix?: string;
    keyPrefix?: string;
    valueLookup?: ValueLookup;
    valueNotFound?: string;
}

Properties

keyPattern?: string

Defines middle part of the regular expression to lookup key values, the default is [\\p{Letter}\\p{Mark}\\d_.$-]+.

keyPatternFlags?: string

Defines regex flags, like g and u or i. The default is gu

keyPostfix?: string

Defines postfix of the regular expression to lookup key values, the default is \\}.

keyPrefix?: string

Defines prefix of the regular expression to lookup key values, the default is \\$\\{.

valueLookup?: ValueLookup

custom function to lookup values for keys from the second parameter provided to the created replacer function.

valueNotFound?: string

Defines the value used if the key lookup provides no value, by default this property is undefined, which means that the input key expression is kept.