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

    Function defaultIfEmpty

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

      Parameters

      • Optionaltext: string | null

        The text to check

      • OptionaldefaultValue: string | null

        The default value placeholder

      Returns string | null | undefined

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

      David Hsing

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