plexis-js / plexis

Lo-fi, powerful, community-driven string manipulation library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: `isEmpty`

vorillaz opened this issue · comments

Checks whether the input text is empty.

Example usage

import isEmpty from '@plexis/is-empty';

isEmpty('');
// => true

isEmpty('   ');
// => true


isEmpty(' b  ');
// => false

Aliases

import isEmpty from '@plexis/is-empty';
import {isEmpty} from 'plexis';

Hi, I was working on this and created a package that works as described. However I am facing a problem where packages/plexis/test/index.js test cases is not passing. I tried running test without making any changes to original repository and it didn't pass there either.
I am pretty new to this so it would be nice to get some pointers.

Screenshot of the problem:-
Screenshot from 2019-10-21 02-31-33

@eElec Hello, try to run yarn && yarn bootstrap after adding your package. This will allow Lerna to access all internal packages. For snapshot testing use yarn test -u

isEmpty(' ');
// => true

Shouldn't this be false? IMHO a white space should not be considered an empty string. Renaming this to isBlank would clear any confusion, and align it with other string utilities (like StringUtils in Java)

@ColinFrick You are not actually right, considering a string with whitespaces is empty.