map.apps Bundle APIs 4.20.0
    Preparing search index...

    Variable replaceConst

    replace: StringReplacer = ...

    A default string replace function with the default options.

    Replace ${key} using object as key to value mapping

    import {replace} from "apprt-core/string-replace";

    const msg = replace("${name} says ${msg}", { msg: "hello" });
    msg === "${name} says hello"; // true

    Replacing ${key} using custom value lookup function

    import {replace} from "apprt-core/string-replace";

    const msg = replace("${name} says ${msg}", (key) => key === "msg" ? "hello" : "");
    msg === " says hello"; // true

    the string template

    record of values or a lookup function

    a string with all ${key} expressions replaced by matching values in valueLookup.