Skip to content

Commit

Permalink
fix(utils): ensure string methods apply to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
cueedee committed May 12, 2015
1 parent 2d780f8 commit 040c919
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/youtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports =
{
isIdentifier: function ( value )
{
return /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/.test( value.trim() );
return /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/.test(( '' + value ).trim() );
}

, isNonBlank: function ( value )
Expand All @@ -21,7 +21,7 @@ module.exports =
//
, isNpmName: function ( value )
{
return value === encodeURIComponent( value ) && value === value.toLowerCase();
return value === encodeURIComponent( value ) && value === ( '' + value ).toLowerCase();
}

, sentencify: function ( value )
Expand Down

0 comments on commit 040c919

Please sign in to comment.