Maps blank string to arbitrary value. Returns value as is if not blank.
The string to check
Function to call if string is blank
The original string if not blank, or the result of thenThunk() if blank
ifBlank(' ', () => 'was blank') // 'was blank'ifBlank('hello', () => 'was blank') // 'hello' Copy
ifBlank(' ', () => 'was blank') // 'was blank'ifBlank('hello', () => 'was blank') // 'hello'
Maps blank string to arbitrary value. Returns value as is if not blank.