• Returns a string that concat the given prefix and text

    Parameters

    • Optionaltext: null | string

      the text to check

    • Optionalprefix: string

      the prefix to prepend

    Returns string | undefined | null

    a string that concat the given prefix and text

    prependIfMissing('bar', 'foo');    // 'foobar'
    prependIfMissing('foobar', 'foo'); // 'foobar'