Interpolates placeholders in a string with values from a given object.
Placeholders are in the format {key}. If the key exists in vars,
it will be replaced with the corresponding value. Otherwise, the placeholder
remains unchanged.
Parameters
str: string
The string containing placeholders.
vars: Record<string,any>
An object mapping keys to values for interpolation.
Interpolates placeholders in a string with values from a given object.
Placeholders are in the format
{key}
. If the key exists invars
, it will be replaced with the corresponding value. Otherwise, the placeholder remains unchanged.