• Returns the default value if the given text is blank, or the text self if it is not blank

    Parameters

    • Optionaltext: null | string

      the text to check

    • OptionaldefaultValue: null | string

      the default value placeholder

    Returns string | undefined | null

    the default value if the given text is blank, or the text self if it is not blank

    defaultIfBlank(undefined, 'foobar');    // 'foobar'