@yookue/ts-lang-utils
    Preparing search index...

    Function formatPlaceholder

    • Returns the replaced string of the source string (named placeholder) with the given parameters

      Parameters

      • Optionaltext: null | string

        the source string to inspect

      • Optionalparams: { [key: string]: any }

        the parameters to replaced with, in the form of key values

      Returns undefined | null | string

      the replaced string of the source string

      David Hsing

      formatPlaceholder("foo{bar}", {bar: "bar"});    //  "foobar"
      formatPlaceholder("foobar{none}"); // "foobar{none}"
      formatPlaceholder("foobar{none}", {}); // "foobar{none}"
      formatPlaceholder("hello {name}, foo{bar}", {name: "world", bar: "bar"}); // "hello world, foobar"