• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

horiuchi / dtsgenerator / 5572977410

pending completion
5572977410

Pull #555

github

web-flow
Merge 0bee8e546 into 24d8037fd
Pull Request #555: Add support for additionalProperties: false on empty objects

677 of 779 branches covered (86.91%)

2 of 2 new or added lines in 1 file covered. (100.0%)

1117 of 1227 relevant lines covered (91.04%)

4522.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.35
/src/core/validateIdentifier.ts
1
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2
import { ScriptTarget } from 'typescript';
3✔
3

4
// via. https://github.com/microsoft/TypeScript/blob/v3.7.5/src/services/codefixes/importFixes.ts#L689
5
export function checkInvalidCharacter(
3✔
6
    text: string,
7
    target: ScriptTarget
8
): boolean {
9
    const firstCharCode = text.charCodeAt(0);
4,056✔
10
    if (!isIdentifierStart(firstCharCode, target)) {
4,056✔
11
        return false;
9✔
12
    }
13
    for (let i = 1; i < text.length; i++) {
4,047✔
14
        const ch = text.charCodeAt(i);
24,387✔
15
        if (!isIdentifierPart(ch, target)) {
24,387✔
16
            return false;
9✔
17
        }
18
    }
19
    return true;
4,038✔
20
}
21
export function toValidIdentifier(text: string, target: ScriptTarget): string {
3✔
22
    if (/^\d/.test(text)) {
8,571!
23
        text = '$' + text;
×
24
    }
25
    let res = '';
8,571✔
26
    let lastCharWasValid = true;
8,571✔
27
    const firstCharCode = text.charCodeAt(0);
8,571✔
28
    if (isIdentifierStart(firstCharCode, target)) {
8,571!
29
        res += String.fromCharCode(firstCharCode);
8,571✔
30
    } else {
31
        lastCharWasValid = false;
×
32
    }
33
    for (let i = 1; i < text.length; i++) {
8,571✔
34
        const ch = text.charCodeAt(i);
73,332✔
35
        const isValid = isIdentifierPart(ch, target);
73,332✔
36
        if (isValid) {
73,332!
37
            let char = String.fromCharCode(ch);
73,332✔
38
            if (!lastCharWasValid) {
73,332!
39
                char = char.toUpperCase();
×
40
            }
41
            res += char;
73,332✔
42
        }
43
        lastCharWasValid = isValid;
73,332✔
44
    }
45
    // Need `|| "_"` to ensure result isn't empty.
46
    return res || '_';
8,571!
47
}
48
export function toTypeName(text: string, target: ScriptTarget): string {
3✔
49
    if (/^\d/.test(text)) {
39,459✔
50
        text = '$' + text;
516✔
51
    }
52
    let res = '';
39,459✔
53
    let lastCharWasValid = true;
39,459✔
54
    const firstCharCode = text.charCodeAt(0);
39,459✔
55
    if (
39,459!
56
        firstCharCode !== CharacterCodes._ &&
78,918✔
57
        isIdentifierStart(firstCharCode, target)
58
    ) {
59
        res += String.fromCharCode(firstCharCode).toUpperCase();
39,459✔
60
        if (firstCharCode === CharacterCodes.$) {
39,459✔
61
            lastCharWasValid = false;
516✔
62
        }
63
    } else {
64
        lastCharWasValid = false;
×
65
    }
66
    for (let i = 1; i < text.length; i++) {
39,459✔
67
        const ch = text.charCodeAt(i);
323,127✔
68
        const isValid = ch !== CharacterCodes._ && isIdentifierPart(ch, target);
323,127✔
69
        if (isValid) {
323,127✔
70
            let char = String.fromCharCode(ch);
306,774✔
71
            if (!lastCharWasValid) {
306,774✔
72
                char = char.toUpperCase();
16,947✔
73
            }
74
            res += char;
306,774✔
75
        }
76
        lastCharWasValid = isValid && ch !== CharacterCodes.$;
323,127✔
77
    }
78
    // Need `|| "_"` to ensure result isn't empty.
79
    return res || '_';
39,459!
80
}
81

82
const enum CharacterCodes {
83
    nullCharacter = 0,
84
    maxAsciiCharacter = 0x7f,
85

86
    lineFeed = 0x0a, // \n
87
    carriageReturn = 0x0d, // \r
88
    lineSeparator = 0x2028,
89
    paragraphSeparator = 0x2029,
90
    nextLine = 0x0085,
91

92
    // Unicode 3.0 space characters
93
    space = 0x0020, // " "
94
    nonBreakingSpace = 0x00a0, //
95
    enQuad = 0x2000,
96
    emQuad = 0x2001,
97
    enSpace = 0x2002,
98
    emSpace = 0x2003,
99
    threePerEmSpace = 0x2004,
100
    fourPerEmSpace = 0x2005,
101
    sixPerEmSpace = 0x2006,
102
    figureSpace = 0x2007,
103
    punctuationSpace = 0x2008,
104
    thinSpace = 0x2009,
105
    hairSpace = 0x200a,
106
    zeroWidthSpace = 0x200b,
107
    narrowNoBreakSpace = 0x202f,
108
    ideographicSpace = 0x3000,
109
    mathematicalSpace = 0x205f,
110
    ogham = 0x1680,
111

112
    _ = 0x5f,
113
    $ = 0x24,
114

115
    _0 = 0x30,
116
    _1 = 0x31,
117
    _2 = 0x32,
118
    _3 = 0x33,
119
    _4 = 0x34,
120
    _5 = 0x35,
121
    _6 = 0x36,
122
    _7 = 0x37,
123
    _8 = 0x38,
124
    _9 = 0x39,
125

126
    a = 0x61,
127
    b = 0x62,
128
    c = 0x63,
129
    d = 0x64,
130
    e = 0x65,
131
    f = 0x66,
132
    g = 0x67,
133
    h = 0x68,
134
    i = 0x69,
135
    j = 0x6a,
136
    k = 0x6b,
137
    l = 0x6c,
138
    m = 0x6d,
139
    n = 0x6e,
140
    o = 0x6f,
141
    p = 0x70,
142
    q = 0x71,
143
    r = 0x72,
144
    s = 0x73,
145
    t = 0x74,
146
    u = 0x75,
147
    v = 0x76,
148
    w = 0x77,
149
    x = 0x78,
150
    y = 0x79,
151
    z = 0x7a,
152

153
    A = 0x41,
154
    B = 0x42,
155
    C = 0x43,
156
    D = 0x44,
157
    E = 0x45,
158
    F = 0x46,
159
    G = 0x47,
160
    H = 0x48,
161
    I = 0x49,
162
    J = 0x4a,
163
    K = 0x4b,
164
    L = 0x4c,
165
    M = 0x4d,
166
    N = 0x4e,
167
    O = 0x4f,
168
    P = 0x50,
169
    Q = 0x51,
170
    R = 0x52,
171
    S = 0x53,
172
    T = 0x54,
173
    U = 0x55,
174
    V = 0x56,
175
    W = 0x57,
176
    X = 0x58,
177
    Y = 0x59,
178
    Z = 0x5a,
179

180
    ampersand = 0x26, // &
181
    asterisk = 0x2a, // *
182
    at = 0x40, // @
183
    backslash = 0x5c, // \
184
    backtick = 0x60, // `
185
    bar = 0x7c, // |
186
    caret = 0x5e, // ^
187
    closeBrace = 0x7d, // }
188
    closeBracket = 0x5d, // ]
189
    closeParen = 0x29, // )
190
    colon = 0x3a, // :
191
    comma = 0x2c, // ,
192
    dot = 0x2e, // .
193
    doubleQuote = 0x22, // "
194
    equals = 0x3d, // =
195
    exclamation = 0x21, // !
196
    greaterThan = 0x3e, // >
197
    hash = 0x23, // #
198
    lessThan = 0x3c, // <
199
    minus = 0x2d, // -
200
    openBrace = 0x7b, // {
201
    openBracket = 0x5b, // [
202
    openParen = 0x28, // (
203
    percent = 0x25, // %
204
    plus = 0x2b, // +
205
    question = 0x3f, // ?
206
    semicolon = 0x3b, // ;
207
    singleQuote = 0x27, // '
208
    slash = 0x2f, // /
209
    tilde = 0x7e, // ~
210

211
    backspace = 0x08, // \b
212
    formFeed = 0x0c, // \f
213
    byteOrderMark = 0xfeff,
214
    tab = 0x09, // \t
215
    verticalTab = 0x0b, // \v
216
}
217

218
/*
219
    As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers
220
    IdentifierStart ::
221
        Can contain Unicode 3.0.0 categories:
222
        Uppercase letter (Lu),
223
        Lowercase letter (Ll),
224
        Titlecase letter (Lt),
225
        Modifier letter (Lm),
226
        Other letter (Lo), or
227
        Letter number (Nl).
228
    IdentifierPart :: =
229
        Can contain IdentifierStart + Unicode 3.0.0 categories:
230
        Non-spacing mark (Mn),
231
        Combining spacing mark (Mc),
232
        Decimal number (Nd), or
233
        Connector punctuation (Pc).
234
    Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at:
235
    http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt
236
*/
237
const unicodeES3IdentifierStart = [
3✔
238
    170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592,
239
    685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902,
240
    904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153,
241
    1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366,
242
    1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610,
243
    1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836,
244
    1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444,
245
    2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525,
246
    2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608,
247
    2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676,
248
    2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739,
249
    2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832,
250
    2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909,
251
    2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972,
252
    2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084,
253
    3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212,
254
    3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297,
255
    3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478,
256
    3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635,
257
    3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725,
258
    3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755,
259
    3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805,
260
    3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135,
261
    4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514,
262
    4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694,
263
    4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782,
264
    4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814,
265
    4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894,
266
    4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786,
267
    5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929,
268
    7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025,
269
    8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126,
270
    8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180,
271
    8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469,
272
    8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497,
273
    8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344,
274
    12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588,
275
    12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032,
276
    55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296,
277
    64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326,
278
    64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138,
279
    65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474,
280
    65479, 65482, 65487, 65490, 65495, 65498, 65500,
281
];
282
const unicodeES3IdentifierPart = [
3✔
283
    170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592,
284
    685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866,
285
    890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986,
286
    1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232,
287
    1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443,
288
    1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520,
289
    1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759,
290
    1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305,
291
    2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433,
292
    2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486,
293
    2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524,
294
    2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579,
295
    2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622,
296
    2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689,
297
    2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738,
298
    2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784,
299
    2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858,
300
    2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902,
301
    2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958,
302
    2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984,
303
    2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031,
304
    3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114,
305
    3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168,
306
    3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242,
307
    3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294,
308
    3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346,
309
    3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424,
310
    3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517,
311
    3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570,
312
    3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719,
313
    3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749,
314
    3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782,
315
    3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872,
316
    3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953,
317
    3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131,
318
    4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256,
319
    4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616,
320
    4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704,
321
    4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792,
322
    4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848,
323
    4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969,
324
    4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016,
325
    6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840,
326
    7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025,
327
    8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126,
328
    8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178,
329
    8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450,
330
    8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486,
331
    8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293,
332
    12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442,
333
    12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312,
334
    19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262,
335
    64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320,
336
    64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967,
337
    65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140,
338
    65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370,
339
    65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,
340
];
341

342
/*
343
    As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers
344
    IdentifierStart ::
345
        Can contain Unicode 6.2 categories:
346
        Uppercase letter (Lu),
347
        Lowercase letter (Ll),
348
        Titlecase letter (Lt),
349
        Modifier letter (Lm),
350
        Other letter (Lo), or
351
        Letter number (Nl).
352
    IdentifierPart ::
353
        Can contain IdentifierStart + Unicode 6.2 categories:
354
        Non-spacing mark (Mn),
355
        Combining spacing mark (Mc),
356
        Decimal number (Nd),
357
        Connector punctuation (Pc),
358
        <ZWNJ>, or
359
        <ZWJ>.
360
    Codepoint ranges for ES5 Identifiers are extracted from the Unicode 6.2 specification at:
361
    http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt
362
*/
363
const unicodeES5IdentifierStart = [
3✔
364
    170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736,
365
    740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906,
366
    908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369,
367
    1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649,
368
    1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808,
369
    1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042,
370
    2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208,
371
    2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417,
372
    2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482,
373
    2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544,
374
    2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613,
375
    2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703,
376
    2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768,
377
    2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866,
378
    2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947,
379
    2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974,
380
    2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086,
381
    3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168,
382
    3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261,
383
    3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346,
384
    3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482,
385
    3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648,
386
    3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732,
387
    3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757,
388
    3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840,
389
    3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176,
390
    4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238,
391
    4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682,
392
    4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752,
393
    4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824,
394
    4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743,
395
    5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920,
396
    5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108,
397
    6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480,
398
    6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823,
399
    6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168,
400
    7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424,
401
    7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025,
402
    8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126,
403
    8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178,
404
    8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455,
405
    8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488,
406
    8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544,
407
    8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507,
408
    11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648,
409
    11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718,
410
    11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321,
411
    12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538,
412
    12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312,
413
    19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527,
414
    42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786,
415
    42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013,
416
    43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259,
417
    43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471,
418
    43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648,
419
    43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714,
420
    43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793,
421
    43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238,
422
    55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285,
423
    64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321,
424
    64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008,
425
    65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470,
426
    65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,
427
];
428
const unicodeES5IdentifierPart = [
3✔
429
    170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736,
430
    740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906,
431
    908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329,
432
    1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476,
433
    1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646,
434
    1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869,
435
    1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210,
436
    2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433,
437
    2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486,
438
    2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527,
439
    2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602,
440
    2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631,
441
    2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689,
442
    2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741,
443
    2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790,
444
    2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866,
445
    2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908,
446
    2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958,
447
    2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984,
448
    2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031,
449
    3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114,
450
    3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160,
451
    3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218,
452
    3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285,
453
    3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333,
454
    3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415,
455
    3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482,
456
    3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542,
457
    3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713,
458
    3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737,
459
    3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771,
460
    3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840,
461
    3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902,
462
    3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096,
463
    4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348,
464
    4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746,
465
    4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808,
466
    4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024,
467
    5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888,
468
    5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002,
469
    6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160,
470
    6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448,
471
    6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656,
472
    6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912,
473
    6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245,
474
    7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968,
475
    8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031,
476
    8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144,
477
    8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255,
478
    8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417,
479
    8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473,
480
    8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508,
481
    8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360,
482
    11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623,
483
    11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704,
484
    11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775,
485
    11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353,
486
    12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589,
487
    12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960,
488
    42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621,
489
    42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896,
490
    42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225,
491
    43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392,
492
    43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638,
493
    43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777,
494
    43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010,
495
    44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744,
496
    64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310,
497
    64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467,
498
    64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062,
499
    65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313,
500
    65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487,
501
    65490, 65495, 65498, 65500,
502
];
503

504
/**
505
 * Generated by scripts/regenerate-unicode-identifier-parts.js on node v12.4.0 with unicode 12.1
506
 * based on http://www.unicode.org/reports/tr31/ and https://www.ecma-international.org/ecma-262/6.0/#sec-names-and-keywords
507
 * unicodeESNextIdentifierStart corresponds to the ID_Start and Other_ID_Start property, and
508
 * unicodeESNextIdentifierPart corresponds to ID_Continue, Other_ID_Continue, plus ID_Start and Other_ID_Start
509
 */
510
const unicodeESNextIdentifierStart = [
3✔
511
    65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705,
512
    710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895,
513
    895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162,
514
    1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568,
515
    1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786,
516
    1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994,
517
    2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088,
518
    2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365,
519
    2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451,
520
    2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524,
521
    2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579,
522
    2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654,
523
    2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738,
524
    2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821,
525
    2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877,
526
    2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958,
527
    2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984,
528
    2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114,
529
    3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214,
530
    3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296,
531
    3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406,
532
    3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507,
533
    3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713,
534
    3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762,
535
    3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904,
536
    3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186,
537
    4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256,
538
    4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688,
539
    4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786,
540
    4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882,
541
    4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743,
542
    5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920,
543
    5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108,
544
    6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480,
545
    6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823,
546
    6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168,
547
    7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401,
548
    7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960,
549
    7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029,
550
    8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134,
551
    8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305,
552
    8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469,
553
    8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508,
554
    8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360,
555
    11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565,
556
    11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696,
557
    11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742,
558
    12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443,
559
    12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730,
560
    12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240,
561
    42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735,
562
    42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011,
563
    43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255,
564
    43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396,
565
    43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560,
566
    43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697,
567
    43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741,
568
    43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808,
569
    43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203,
570
    55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275,
571
    64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318,
572
    64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914,
573
    64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370,
574
    65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536,
575
    65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629,
576
    65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349,
577
    66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517,
578
    66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072,
579
    67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637,
580
    67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808,
581
    67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031,
582
    68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224,
583
    68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466,
584
    68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376,
585
    69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807,
586
    69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019,
587
    70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187,
588
    70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320,
589
    70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451,
590
    70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727,
591
    70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086,
592
    71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424,
593
    71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144,
594
    72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272,
595
    72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750,
596
    72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030,
597
    73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458,
598
    73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160,
599
    92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047,
600
    93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176,
601
    94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928,
602
    110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788,
603
    113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966,
604
    119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993,
605
    119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077,
606
    120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132,
607
    120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514,
608
    120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654,
609
    120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772,
610
    120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627,
611
    124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469,
612
    126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514,
613
    126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535,
614
    126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546,
615
    126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557,
616
    126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570,
617
    126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592,
618
    126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651,
619
    131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984,
620
    191456, 194560, 195101,
621
];
622
const unicodeESNextIdentifierPart = [
3✔
623
    48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186,
624
    192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768,
625
    884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013,
626
    1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416,
627
    1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514,
628
    1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768,
629
    1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042,
630
    2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237,
631
    2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448,
632
    2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504,
633
    2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556,
634
    2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608,
635
    2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632,
636
    2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691,
637
    2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745,
638
    2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799,
639
    2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864,
640
    2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903,
641
    2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954,
642
    2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980,
643
    2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024,
644
    3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129,
645
    3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171,
646
    3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251,
647
    3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294,
648
    3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344,
649
    3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439,
650
    3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517,
651
    3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567,
652
    3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716,
653
    3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782,
654
    3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881,
655
    3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972,
656
    3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293,
657
    4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694,
658
    4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789,
659
    4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885,
660
    4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117,
661
    5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900,
662
    5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003,
663
    6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169,
664
    6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459,
665
    6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683,
666
    6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845,
667
    6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241,
668
    7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418,
669
    7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023,
670
    8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124,
671
    8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172,
672
    8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319,
673
    8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455,
674
    8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488,
675
    8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310,
676
    11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565,
677
    11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694,
678
    11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736,
679
    11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348,
680
    12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593,
681
    12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124,
682
    42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623,
683
    42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047,
684
    43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261,
685
    43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518,
686
    43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739,
687
    43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798,
688
    43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012,
689
    44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109,
690
    64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312,
691
    64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829,
692
    64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075,
693
    65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338,
694
    65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490,
695
    65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597,
696
    65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176,
697
    66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426,
698
    66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720,
699
    66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382,
700
    67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639,
701
    67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826,
702
    67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096,
703
    68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154,
704
    68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352,
705
    68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786,
706
    68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424,
707
    69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864,
708
    69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006,
709
    70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161,
710
    70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287,
711
    70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412,
712
    70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459,
713
    70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499,
714
    70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784,
715
    70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133,
716
    71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424,
717
    71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935,
718
    72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263,
719
    72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758,
720
    72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960,
721
    72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031,
722
    73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107,
723
    73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075,
724
    77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880,
725
    92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047,
726
    93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176,
727
    94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928,
728
    110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788,
729
    113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149,
730
    119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364,
731
    119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973,
732
    119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003,
733
    120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094,
734
    120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144,
735
    120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572,
736
    120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712,
737
    120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344,
738
    121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503,
739
    121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915,
740
    122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209,
741
    123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184,
742
    125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498,
743
    126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521,
744
    126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537,
745
    126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551,
746
    126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559,
747
    126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580,
748
    126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619,
749
    126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824,
750
    177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101,
751
    917760, 917999,
752
];
753

754
function lookupInUnicodeMap(code: number, map: readonly number[]): boolean {
755
    // Bail out quickly if it couldn't possibly be in the map.
756
    if (code < map[0]!) {
×
757
        return false;
×
758
    }
759

760
    // Perform binary search in one of the Unicode range maps
761
    let lo = 0;
×
762
    let hi: number = map.length;
×
763
    let mid: number;
764

765
    while (lo + 1 < hi) {
×
766
        mid = lo + (hi - lo) / 2;
×
767
        // mid has to be even to catch a range's beginning
768
        mid -= mid % 2;
×
769
        if (map[mid]! <= code && code <= map[mid + 1]!) {
×
770
            return true;
×
771
        }
772

773
        if (code < map[mid]!) {
×
774
            hi = mid;
×
775
        } else {
776
            lo = mid + 2;
×
777
        }
778
    }
779

780
    return false;
×
781
}
782

783
function isUnicodeIdentifierStart(code: number, languageVersion: ScriptTarget) {
784
    return languageVersion >= ScriptTarget.ES2015
×
785
        ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart)
786
        : languageVersion === ScriptTarget.ES5
×
787
        ? lookupInUnicodeMap(code, unicodeES5IdentifierStart)
788
        : lookupInUnicodeMap(code, unicodeES3IdentifierStart);
789
}
790

791
function isUnicodeIdentifierPart(code: number, languageVersion: ScriptTarget) {
792
    return languageVersion >= ScriptTarget.ES2015
×
793
        ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart)
794
        : languageVersion === ScriptTarget.ES5
×
795
        ? lookupInUnicodeMap(code, unicodeES5IdentifierPart)
796
        : lookupInUnicodeMap(code, unicodeES3IdentifierPart);
797
}
798

799
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean {
800
    return (
52,086✔
801
        (ch >= CharacterCodes.A && ch <= CharacterCodes.Z) ||
189,255!
802
        (ch >= CharacterCodes.a && ch <= CharacterCodes.z) ||
803
        ch === CharacterCodes.$ ||
804
        ch === CharacterCodes._ ||
805
        (ch > CharacterCodes.maxAsciiCharacter &&
806
            isUnicodeIdentifierStart(ch, languageVersion))
807
    );
808
}
809

810
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean {
811
    return (
418,566✔
812
        (ch >= CharacterCodes.A && ch <= CharacterCodes.Z) ||
1,676,262!
813
        (ch >= CharacterCodes.a && ch <= CharacterCodes.z) ||
814
        (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) ||
815
        ch === CharacterCodes.$ ||
816
        ch === CharacterCodes._ ||
817
        (ch > CharacterCodes.maxAsciiCharacter &&
818
            isUnicodeIdentifierPart(ch, languageVersion))
819
    );
820
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc