Interpolate placeholder values found in the given string.
The given string may contain placeholder values in the form of
function stringInterpolate(str: string, values: object): string
str:string
String which possibly contains placeholder values to be replaced.
values:object
Object where keys are placeholders.
The string with placeholders replaced by values.
import { stringInterpolate } from 'utils/strings';
const str = 'Press $key$ now';
const values = {
key: 'ENTER'
};
console.log(stringInterpolate(str, values)); // Outputs: 'Press ENTER now'