map.apps Bundle APIs 4.20.0
    Preparing search index...
    • Creates a string template replacer function.

      Parameters

      Returns StringReplacer

      string replacer function.

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

      const replace = customReplacer({
      valueNotFound: ""
      });

      const 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]
      });

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