Permalink
Browse files

Fixed a few errors where where `isNaN` would return true for input.

  • Loading branch information...
1 parent 048203a commit a72f0d5e82721bc5476ff4e09a074fcfff0937d7 @larzconwell larzconwell committed Aug 31, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/string.js
View
@@ -50,7 +50,9 @@ string = new (function () {
var string = str;
// If string is NaN, null or undefined then provide an empty default
- if(string == null || isNaN(string)) {
+ if((typeof string === 'undefined') ||
+ string === null ||
+ (!string && isNaN(string))) {
string = '';
}
string = string.toString();

0 comments on commit a72f0d5

Please sign in to comment.