Need private packages and team management tools?Check out npm Teams »

is-empty-null-undef-nan-whitespace

1.0.1 • 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

const StringUtils = require('StringUtils');
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.1

License

ISC

Unpacked Size

10.8 kB

Total Files

6

Last publish

Collaborators

  • avatar