summaryrefslogtreecommitdiff
path: root/src/ljstype.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann@users.noreply.github.com>2017-03-21 09:09:16 +0100
committerGitHub <noreply@github.com>2017-03-21 09:09:16 +0100
commit932875c87ab3f2ed2b676a98f273392661535f65 (patch)
tree505f463ecdd0b4be4f0ce3e6446183774d406783 /src/ljstype.js
parent9ac1d380dd1da894c6317845ea3234124663714b (diff)
parent6bf508f234654b1b0c7afa04797601d14c150934 (diff)
downloadfengari-932875c87ab3f2ed2b676a98f273392661535f65.tar.gz
fengari-932875c87ab3f2ed2b676a98f273392661535f65.tar.bz2
fengari-932875c87ab3f2ed2b676a98f273392661535f65.zip
Merge pull request #8 from giann/feature/match
Feature/match
Diffstat (limited to 'src/ljstype.js')
-rw-r--r--src/ljstype.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ljstype.js b/src/ljstype.js
index ef4be1d..7de9d9a 100644
--- a/src/ljstype.js
+++ b/src/ljstype.js
@@ -3,23 +3,23 @@
const assert = require('assert');
const lisdigit = function(c) {
- return /^\d$/.test(c.charAt(0));
+ return typeof c === 'string' && /^\d$/.test(c.charAt(0));
};
const lisxdigit = function(c) {
- return /^[0-9a-fA-F]$/.test(c.charAt(0));
+ return typeof c === 'string' && /^[0-9a-fA-F]$/.test(c.charAt(0));
};
const lisspace = function(c) {
- return /^\s$/.test(c.charAt(0));
+ return typeof c === 'string' && /^\s$/.test(c.charAt(0));
};
const lislalpha = function(c) {
- return /^[_a-zA-Z]$/.test(c.charAt(0));
+ return typeof c === 'string' && /^[_a-zA-Z]$/.test(c.charAt(0));
};
const lislalnum = function(c) {
- return /^[_a-zA-Z0-9]$/.test(c.charAt(0));
+ return typeof c === 'string' && /^[_a-zA-Z0-9]$/.test(c.charAt(0));
};
module.exports.lisdigit = lisdigit;