@chenfengyuan/is-empty-string

1.0.0 • Public • Published

is-empty-string

Build Status Coverage Status Downloads Version

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('');
// > true

isEmptyString(' ');
// > false

isEmptyString(' ', true);
// > true

isEmptyString('foo');
// > false

isEmptyString(1);
// > false

License

MIT © Chen Fengyuan

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i @chenfengyuan/is-empty-string

    Weekly Downloads

    5

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    7.23 kB

    Total Files

    9

    Last publish

    Collaborators

    • chenfengyuan