Function: isEmpty()
isEmpty(
str):boolean
Defined in: string/validators/index.ts:26
Checks if a string is empty or contains only whitespace.
Parameters
str
string
The string to check
Returns
boolean
True if the string is empty or whitespace-only
Example
isEmpty('')
// => true
isEmpty(' ')
// => true
isEmpty('hello')
// => false
isEmpty(' hello ')
// => false
See
isBlank - alias for isEmpty