Optional
options: ReplaceOptionsoptions of replacement function
string replacer function.
import {customReplacer} from "apprt-core/string-replace";
const replace = customReplacer({
valueNotFound: ""
});
let msg = replace("${name} says ${msg}",{msg: "hello" });
msg === " says hello"; // true
import {customReplacer} from "apprt-core/string-replace";
const replace = customReplacer({
// use custom key value lookup function
valueLookup: (key, values) => values[key]
});
let msg = replace("Says ${msg}",{msg: "hello" });
msg === "Says hello"; // true
Generated using TypeDoc
Creates a string template replacer function.