The string value to interpolate.
An object of key/value pairs to replace the tokens.
The symbol that identifies a token.
The interpolated string.
import { interpolate } from '@untemps/utils/string/interpolate'const value = 'A %foo% with a "%bar%" wings and a lot of %fun%'const tokens = { foo: 'bird', bar: 3, fun: 'dignity'}const divider = '%'interpolate(value, tokens, divider) // A bird with a "3" wings and a lot of dignity Copy
import { interpolate } from '@untemps/utils/string/interpolate'const value = 'A %foo% with a "%bar%" wings and a lot of %fun%'const tokens = { foo: 'bird', bar: 3, fun: 'dignity'}const divider = '%'interpolate(value, tokens, divider) // A bird with a "3" wings and a lot of dignity
The string value to interpolate.