is-empty-string

Check if the given value is an empty string.
Main
dist/
├── is-empty-string.js (UMD)
├── is-empty-string.min.js (UMD, compressed)
├── is-empty-string.common.js (CommonJS, default)
└── is-empty-string.esm.js (ES Module)
Install
npm install @chenfengyuan/is-empty-string
Usage
Syntax
isEmptyString(value, trim = false);
-
value
- Type:
*
- The value to check.
-
trim (optional)
- Type:
Boolean
- Default:
false
- Indicates if remove whitespace from both ends of the value before length checking or not.
-
(return value)
- Type:
Boolean
- Returns
true
if the given value is an empty string, else false
.
Examples
import isEmptyString from '@chenfengyuan/is-empty-string';
isEmptyString('');
isEmptyString(' ');
isEmptyString(' ', true);
isEmptyString('foo');
isEmptyString(1);
License
MIT © Chen Fengyuan