diff options
Diffstat (limited to 'src/ljstype.js')
-rw-r--r-- | src/ljstype.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ljstype.js b/src/ljstype.js index 7de9d9a..6f371bb 100644 --- a/src/ljstype.js +++ b/src/ljstype.js @@ -3,27 +3,27 @@ const assert = require('assert'); const lisdigit = function(c) { - return typeof c === 'string' && /^\d$/.test(c.charAt(0)); + return /^\d$/.test(String.fromCharCode(c)); }; const lisxdigit = function(c) { - return typeof c === 'string' && /^[0-9a-fA-F]$/.test(c.charAt(0)); + return /^[0-9a-fA-F]$/.test(String.fromCharCode(c)); }; const lisspace = function(c) { - return typeof c === 'string' && /^\s$/.test(c.charAt(0)); + return /^\s$/.test(String.fromCharCode(c)); }; const lislalpha = function(c) { - return typeof c === 'string' && /^[_a-zA-Z]$/.test(c.charAt(0)); + return /^[_a-zA-Z]$/.test(String.fromCharCode(c)); }; const lislalnum = function(c) { - return typeof c === 'string' && /^[_a-zA-Z0-9]$/.test(c.charAt(0)); + return /^[_a-zA-Z0-9]$/.test(String.fromCharCode(c)); }; module.exports.lisdigit = lisdigit; module.exports.lislalnum = lislalnum; module.exports.lislalpha = lislalpha; module.exports.lisspace = lisspace; -module.exports.lisxdigit = lisxdigit;
\ No newline at end of file +module.exports.lisxdigit = lisxdigit; |