Last change
on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
885 bytes
|
Line | |
---|
1 | const unicode = require('../lib/unicode')
|
---|
2 |
|
---|
3 | module.exports = {
|
---|
4 | isSpaceSeparator (c) {
|
---|
5 | return typeof c === 'string' && unicode.Space_Separator.test(c)
|
---|
6 | },
|
---|
7 |
|
---|
8 | isIdStartChar (c) {
|
---|
9 | return typeof c === 'string' && (
|
---|
10 | (c >= 'a' && c <= 'z') ||
|
---|
11 | (c >= 'A' && c <= 'Z') ||
|
---|
12 | (c === '$') || (c === '_') ||
|
---|
13 | unicode.ID_Start.test(c)
|
---|
14 | )
|
---|
15 | },
|
---|
16 |
|
---|
17 | isIdContinueChar (c) {
|
---|
18 | return typeof c === 'string' && (
|
---|
19 | (c >= 'a' && c <= 'z') ||
|
---|
20 | (c >= 'A' && c <= 'Z') ||
|
---|
21 | (c >= '0' && c <= '9') ||
|
---|
22 | (c === '$') || (c === '_') ||
|
---|
23 | (c === '\u200C') || (c === '\u200D') ||
|
---|
24 | unicode.ID_Continue.test(c)
|
---|
25 | )
|
---|
26 | },
|
---|
27 |
|
---|
28 | isDigit (c) {
|
---|
29 | return typeof c === 'string' && /[0-9]/.test(c)
|
---|
30 | },
|
---|
31 |
|
---|
32 | isHexDigit (c) {
|
---|
33 | return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
|
---|
34 | },
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.