Skip to main content

isBlank

Checks if a string is blank or not (empty, even with white spaces) Nil values are also considered empty.

API

function isBlank(text: string): boolean;

Usage

import { isBlank } from '@feedzai/js-utilities';

isBlank("test")
// false

isBlank("")
// true

isBlank(" ")
// true

isBlank(undefined)
// true

isBlank(null)
// true

isBlank()
// true