summaryrefslogtreecommitdiff
path: root/src/ljstype.js
blob: 2528f74e10a3c83e3069855eb2596786314ffaa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";

const lisdigit = function(c) {
    return /^\d$/.test(String.fromCharCode(c));
};

const lisxdigit = function(c) {
    return /^[0-9a-fA-F]$/.test(String.fromCharCode(c));
};

const lisprint = function(c) {
    return /^[\x20-\x7E]$/.test(String.fromCharCode(c));
};

const lisspace = function(c) {
    return /^\s$/.test(String.fromCharCode(c));
};

const lislalpha = function(c) {
    return /^[_a-zA-Z]$/.test(String.fromCharCode(c));
};

const lislalnum = function(c) {
    return /^[_a-zA-Z0-9]$/.test(String.fromCharCode(c));
};

module.exports.lisdigit   = lisdigit;
module.exports.lislalnum  = lislalnum;
module.exports.lislalpha  = lislalpha;
module.exports.lisprint   = lisprint;
module.exports.lisspace   = lisspace;
module.exports.lisxdigit  = lisxdigit;