Neurologically Paralyzing Mouseovers
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

is-empty-null-undef-nan-whitespace

1.0.3 • Public • Published

isEmptyOrNullOrUndefOrNanOrWhitespace

Utilities to determine if string is any of the following null, empty, undefined, NaN, or whitespace.

Installation

npm:

npm install is-empty-null-undef-nan-whitespace --save

Usage

 
import StringUtils from 'is-empty-null-undef-nan-whitespace';
//or
const StringUtils = require('is-empty-null-undef-nan-whitespace');
const isEmptyOrNullOrUndefOrNanOrWhitespace = StringUtils.isEmptyOrNullOrUndefOrNanOrWhitespace;
 
isEmptyOrNullOrUndefOrNanOrWhitespace('x') // => false
isEmptyOrNullOrUndefOrNanOrWhitespace('_') // => false
isEmptyOrNullOrUndefOrNanOrWhitespace('😊') // => false
isEmptyOrNullOrUndefOrNanOrWhitespace('') // => true
isEmptyOrNullOrUndefOrNanOrWhitespace("") // => true
isEmptyOrNullOrUndefOrNanOrWhitespace(null) // => true
isEmptyOrNullOrUndefOrNanOrWhitespace(undefined) // => true
isEmptyOrNullOrUndefOrNanOrWhitespace(NaN) // => true
isEmptyOrNullOrUndefOrNanOrWhitespace(' ') // => true
isEmptyOrNullOrUndefOrNanOrWhitespace(" ") // => true
isEmptyOrNullOrUndefOrNanOrWhitespace('\n') // => true
isEmptyOrNullOrUndefOrNanOrWhitespace('\r') // => true
isEmptyOrNullOrUndefOrNanOrWhitespace('\t') // => true
isEmptyOrNullOrUndefOrNanOrWhitespace('\u00a0') // => true
isEmptyOrNullOrUndefOrNanOrWhitespace(32) // Chacter code checks => true  

License

MIT © Jeff Tong

Install

npm i is-empty-null-undef-nan-whitespace

DownloadsWeekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

11 kB

Total Files

7

Last publish

Collaborators

  • avatar