Prelude API
    Preparing search index...

    Function ifBlank

    • Maps blank string to arbitrary value. Returns value as is if not blank.

      Type Parameters

      • T

      Parameters

      • value: string

        The string to check

      • thenThunk: () => T

        Function to call if string is blank

      Returns string | T

      The original string if not blank, or the result of thenThunk() if blank

      ifBlank('  ', () => 'was blank') // 'was blank'
      ifBlank('hello', () => 'was blank') // 'hello'