@yookue/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: null | string

        the text to check

      • OptionaldefaultValue: null | string

        the default value placeholder

      Returns undefined | null | string

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

      David Hsing

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