diff options
Diffstat (limited to 'src/lstrlib.js')
-rw-r--r-- | src/lstrlib.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js index 70b9e5f..d3373a4 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -165,8 +165,8 @@ const isalpha = e => ('a'.charCodeAt(0) <= e && e <= 'z'.charCodeAt(0)) || (e >= const isdigit = e => '0'.charCodeAt(0) <= e && e <= '9'.charCodeAt(0); const iscntrl = e => (0x00 <= e && e <= 0x1f) || e === 0x7f; const isgraph = e => e > 32 && e < 127; // TODO: Will only work for ASCII -const islower = e => /^(?![A-Z]).*$/.test(String.fromCharCode(e)); -const isupper = e => /^(?![a-z]).*$/.test(String.fromCharCode(e)); +const islower = e => /^[a-z]$/.test(String.fromCharCode(e)); +const isupper = e => /^[A-Z]$/.test(String.fromCharCode(e)); const isalnum = e => /^[a-zA-Z0-9]$/.test(String.fromCharCode(e)); const ispunct = e => isgraph(e) && !isalnum(e); const isspace = e => /^\s$/.test(String.fromCharCode(e)); |