is-falsy-or-whitespace
v0.0.17
Published
A simple javascript function to determine whether a string is semantically empty, inspired by string.isNullIOrWhitespace in the .NET stack
Downloads
28
Readme
is-falsy-or-whitespace
Introduction
is-falsy-or-whitespace
is a simple function whose purpose is to determine whether a string is semantically empty. It's inspired by string.isNullOrWhitespace
in the .NET stack.
Imports
ES2015 Import
import isFalsyOrWhitespace from 'is-falsy-or-whitespace';
CommonJS Require
const isFalsyOrWhitespace = require('is-falsy-or-whitespace').default;
Results
isFalsyOrWhitespace(null) // true
isFalsyOrWhitespace(undefined) // true
isFalsyOrWhitespace('') // true
isFalsyOrWhitespace(' ') // true
isFalsyOrWhitespace(' ') // true
isFalsyOrWhitespace(0) // true
isFalsyOrWhitespace(NaN) // true
isFalsyOrWhitespace(false) // true
isFalsyOrWhitespace('undefined') // false
isFalsyOrWhitespace('null') // false
isFalsyOrWhitespace('some non blank string') // false
isFalsyOrWhitespace(' a ') // false
isFalsyOrWhitespace([]) // false
isFalsyOrWhitespace({}) // false
isFalsyOrWhitespace(1) // false