Skip to content

Commit b0b17dd

Browse files
committed
fix(Utils): improve is empty
1 parent 5937cd3 commit b0b17dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
* @returns {boolean}
55
*/
66
export const isEmpty = (x) => {
7-
if (typeof x === typeof "") x = x.replace(/\s/g, "");
7+
if (typeof x === typeof "") {
8+
x = x.replace(/\s/g, "");
9+
return x === "";
10+
}
811

912
if (!x) return true;
1013
if (x === "") return true;

0 commit comments

Comments
 (0)