Skip to content
Browse files

Fix the ‘isEmpty’ utility (do not detect a number as an empty object)

  • Loading branch information...
1 parent 944be7f commit ea57a43b8f5ed4dc9168cb7d522425890e2902e2 @Baggz committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/utils/isEmpty.js
View
8 src/utils/isEmpty.js
@@ -7,6 +7,14 @@
*/
var isEmpty = function(input) {
+ if (isNumber(input)) {
+ return false;
+ }
+
+ if (input === null) {
+ return true;
+ }
+
// If the passed-in object is an array or a string
if (isArray(input) || typeof input === 'string') {
return input.length === 0;

0 comments on commit ea57a43

Please sign in to comment.
Something went wrong with that request. Please try again.