lighthouse 13.5.0-dev.20261006 → 13.5.0-dev.20261008
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/audits/insights/insight-audit.d.ts +9 -0
- package/core/audits/insights/insight-audit.js +2 -1
- package/core/computed/trace-engine-result.js +3 -1
- package/core/config/constants.d.ts +2 -28
- package/core/lib/legacy-javascript/legacy-javascript.d.ts +1 -0
- package/core/lib/legacy-javascript/legacy-javascript.js +234 -110
- package/core/lib/legacy-javascript/polyfill-graph-data.json +94 -89
- package/core/lib/legacy-javascript/polyfill-module-data.json +48 -7
- package/core/lib/minification-estimator.js +10 -10
- package/core/lib/trace-engine.d.ts +1 -0
- package/core/lib/trace-engine.js +2 -0
- package/package.json +2 -2
- package/shared/localization/locales/ar-XB.json +157 -136
- package/shared/localization/locales/ar.json +157 -136
- package/shared/localization/locales/bg.json +154 -133
- package/shared/localization/locales/ca.json +157 -136
- package/shared/localization/locales/cs.json +148 -127
- package/shared/localization/locales/da.json +153 -132
- package/shared/localization/locales/de.json +152 -131
- package/shared/localization/locales/el.json +153 -132
- package/shared/localization/locales/en-GB.json +160 -139
- package/shared/localization/locales/en-US.json +153 -141
- package/shared/localization/locales/en-XL.json +153 -141
- package/shared/localization/locales/es-419.json +150 -129
- package/shared/localization/locales/es.json +149 -128
- package/shared/localization/locales/fi.json +151 -130
- package/shared/localization/locales/fil.json +154 -133
- package/shared/localization/locales/fr.json +150 -129
- package/shared/localization/locales/he.json +160 -139
- package/shared/localization/locales/hi.json +156 -135
- package/shared/localization/locales/hr.json +154 -133
- package/shared/localization/locales/hu.json +111 -90
- package/shared/localization/locales/id.json +153 -132
- package/shared/localization/locales/it.json +153 -132
- package/shared/localization/locales/ja.json +150 -129
- package/shared/localization/locales/ko.json +42 -21
- package/shared/localization/locales/lt.json +152 -131
- package/shared/localization/locales/lv.json +93 -72
- package/shared/localization/locales/nl.json +149 -128
- package/shared/localization/locales/no.json +152 -131
- package/shared/localization/locales/pl.json +153 -132
- package/shared/localization/locales/pt-PT.json +152 -131
- package/shared/localization/locales/pt.json +157 -136
- package/shared/localization/locales/ro.json +149 -128
- package/shared/localization/locales/ru.json +73 -52
- package/shared/localization/locales/sk.json +153 -132
- package/shared/localization/locales/sl.json +149 -128
- package/shared/localization/locales/sr-Latn.json +151 -130
- package/shared/localization/locales/sr.json +151 -130
- package/shared/localization/locales/sv.json +152 -131
- package/shared/localization/locales/ta.json +156 -135
- package/shared/localization/locales/te.json +157 -136
- package/shared/localization/locales/th.json +111 -90
- package/shared/localization/locales/tr.json +153 -132
- package/shared/localization/locales/uk.json +149 -128
- package/shared/localization/locales/vi.json +162 -141
- package/shared/localization/locales/zh-HK.json +150 -129
- package/shared/localization/locales/zh-TW.json +154 -133
- package/shared/localization/locales/zh.json +152 -131
|
@@ -1,93 +1,98 @@
|
|
|
1
1
|
{
|
|
2
|
-
"moduleSizes": [
|
|
2
|
+
"moduleSizes": [26175, 498, 282, 294, 281, 467, 164, 236, 229, 765, 555, 339, 300, 1977, 723, 729, 1547, 438, 214, 657, 111, 759, 537, 209, 281, 685, 217, 757, 631, 293, 182, 475, 79, 407, 140, 366, 792, 269, 222, 158, 280, 192, 137, 158, 105, 189, 543, 160, 742, 1436, 88, 978, 146, 314, 375, 183, 1083, 195, 503, 269, 208, 334, 233, 350, 580, 491, 229, 1155, 334, 266, 30, 120, 309, 370, 358, 1952, 1638, 304, 153, 274, 1288, 192, 543, 74, 144, 137, 33, 336, 457, 2219, 535, 711, 1323, 64, 117, 1961, 244, 557, 318, 119, 173, 108, 144, 96, 133, 441, 210, 1627, 1956, 693, 1426, 863, 637, 301, 51, 708, 583, 119, 600, 221, 370, 728, 1085, 552, 629, 125, 1746, 97, 441, 543, 2931, 767, 371, 588, 548, 243, 266, 217, 99, 440, 183, 607, 180, 464, 207, 983, 530, 237, 382, 249, 675, 402, 254, 223, 164, 214, 191, 831, 218, 202, 232, 124, 250, 160, 251, 217, 717, 78, 561, 1696, 256, 386, 225, 432, 499, 394, 364, 445, 625, 680, 177, 346, 663, 142, 588, 414, 686, 1628, 380, 2580, 558, 783, 1410, 1040, 417, 433, 266, 263, 214, 303, 163, 141, 510, 397, 137, 137, 133, 133, 390, 266, 137, 183, 215, 191, 485, 328, 575, 799, 533, 148, 215, 589, 589, 130, 362, 562, 471, 179, 186, 1266, 1456, 366, 521, 1536, 511, 444, 406, 1053, 150, 283, 144, 485, 470, 205, 1268, 796, 658, 595, 306, 3750, 814, 146, 2298, 1226, 881, 1144, 237, 206, 198, 250, 283, 60, 3000],
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"Array.prototype.at": [0, 5,
|
|
5
|
-
"Array.prototype.concat": [0,
|
|
6
|
-
"Array.prototype.copyWithin": [0, 5, 9,
|
|
7
|
-
"Array.prototype.every": [0,
|
|
8
|
-
"Array.prototype.fill": [0, 5, 10,
|
|
9
|
-
"Array.prototype.filter": [0,
|
|
10
|
-
"Array.prototype.find": [0, 5,
|
|
11
|
-
"Array.prototype.findIndex": [0, 5,
|
|
12
|
-
"Array.prototype.findLast": [0, 5,
|
|
13
|
-
"Array.prototype.findLastIndex": [0, 5,
|
|
14
|
-
"Array.prototype.flat": [0,
|
|
15
|
-
"Array.prototype.flatMap": [0,
|
|
16
|
-
"Array.prototype.forEach": [0, 11,
|
|
17
|
-
"Array.from": [0,
|
|
18
|
-
"Array.prototype.
|
|
19
|
-
"Array.
|
|
20
|
-
"Array.
|
|
21
|
-
"Array.prototype.
|
|
22
|
-
"Array.
|
|
23
|
-
"Array.
|
|
24
|
-
"Array.prototype.
|
|
25
|
-
"Array.prototype.
|
|
26
|
-
"Array.prototype.
|
|
27
|
-
"Array.prototype.
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"Math.
|
|
31
|
-
"Math.
|
|
32
|
-
"Math.
|
|
33
|
-
"Math.
|
|
34
|
-
"Math.
|
|
35
|
-
"Math.
|
|
36
|
-
"Math.
|
|
37
|
-
"Math.
|
|
38
|
-
"Math.
|
|
39
|
-
"Math.
|
|
40
|
-
"Math.
|
|
41
|
-
"Math.
|
|
42
|
-
"Math.
|
|
43
|
-
"Math.
|
|
44
|
-
"Math.
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"Object.
|
|
48
|
-
"Object.
|
|
49
|
-
"Object.
|
|
50
|
-
"Object.
|
|
51
|
-
"Object.
|
|
52
|
-
"Object.
|
|
53
|
-
"Object.
|
|
54
|
-
"Object.
|
|
55
|
-
"Object.
|
|
56
|
-
"Object.
|
|
57
|
-
"Object.
|
|
58
|
-
"Object.
|
|
59
|
-
"Object.
|
|
60
|
-
"Object.
|
|
61
|
-
"Object.
|
|
62
|
-
"Object.
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"Reflect.
|
|
68
|
-
"Reflect.
|
|
69
|
-
"Reflect.
|
|
70
|
-
"Reflect.
|
|
71
|
-
"Reflect.
|
|
72
|
-
"Reflect.
|
|
73
|
-
"Reflect.
|
|
74
|
-
"Reflect.
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"String.prototype.
|
|
79
|
-
"String.prototype.
|
|
80
|
-
"String.
|
|
81
|
-
"String.prototype.
|
|
82
|
-
"String.prototype.
|
|
83
|
-
"String.prototype.
|
|
84
|
-
"String.
|
|
85
|
-
"String.prototype.
|
|
86
|
-
"String.prototype.
|
|
87
|
-
"String.prototype.
|
|
88
|
-
"String.prototype.
|
|
89
|
-
"
|
|
90
|
-
"
|
|
4
|
+
"Array.prototype.at": [0, 5, 71, 108, 109, 119, 168],
|
|
5
|
+
"Array.prototype.concat": [0, 17, 19, 22, 23, 27, 35, 41, 78, 80, 159, 169],
|
|
6
|
+
"Array.prototype.copyWithin": [0, 5, 9, 38, 71, 108, 109, 119, 170],
|
|
7
|
+
"Array.prototype.every": [0, 16, 18, 22, 23, 27, 35, 54, 60, 78, 80, 159, 171],
|
|
8
|
+
"Array.prototype.fill": [0, 5, 10, 71, 108, 109, 119, 172],
|
|
9
|
+
"Array.prototype.filter": [0, 16, 17, 22, 23, 27, 35, 54, 60, 78, 80, 159, 173],
|
|
10
|
+
"Array.prototype.find": [0, 5, 16, 22, 23, 27, 35, 54, 60, 71, 78, 80, 108, 109, 119, 159, 177],
|
|
11
|
+
"Array.prototype.findIndex": [0, 5, 16, 22, 23, 27, 35, 54, 60, 71, 78, 80, 108, 109, 119, 159, 174],
|
|
12
|
+
"Array.prototype.findLast": [0, 5, 15, 54, 60, 71, 108, 109, 119, 176],
|
|
13
|
+
"Array.prototype.findLastIndex": [0, 5, 15, 54, 60, 71, 108, 109, 119, 175],
|
|
14
|
+
"Array.prototype.flat": [0, 22, 23, 27, 35, 41, 51, 54, 60, 78, 80, 159, 179],
|
|
15
|
+
"Array.prototype.flatMap": [0, 22, 23, 27, 35, 41, 51, 54, 60, 78, 80, 159, 178],
|
|
16
|
+
"Array.prototype.forEach": [0, 11, 16, 18, 22, 23, 27, 35, 54, 60, 78, 80, 159, 180],
|
|
17
|
+
"Array.from": [0, 13, 19, 24, 25, 27, 35, 41, 54, 60, 64, 65, 77, 78, 80, 90, 93, 159, 181],
|
|
18
|
+
"Array.prototype.indexOf": [0, 18, 60, 182],
|
|
19
|
+
"Array.isArray": [0, 78, 183],
|
|
20
|
+
"Array.prototype.join": [0, 18, 184],
|
|
21
|
+
"Array.prototype.map": [0, 16, 17, 22, 23, 27, 35, 54, 60, 78, 80, 159, 185],
|
|
22
|
+
"Array.of": [0, 19, 27, 35, 78, 80, 159, 186],
|
|
23
|
+
"Array.prototype.slice": [0, 17, 19, 20, 27, 35, 78, 80, 159, 187],
|
|
24
|
+
"Array.prototype.some": [0, 16, 18, 22, 23, 27, 35, 54, 60, 78, 80, 159, 188],
|
|
25
|
+
"Array.prototype.sort": [0, 18, 20, 21, 27, 38, 43, 44, 47, 159, 160, 189],
|
|
26
|
+
"Array.prototype.toReversed": [0, 5, 35, 71, 108, 109, 119, 190],
|
|
27
|
+
"Array.prototype.toSorted": [0, 5, 12, 62, 71, 108, 109, 119, 191],
|
|
28
|
+
"Array.prototype.toSpliced": [0, 5, 35, 41, 71, 108, 109, 119, 192],
|
|
29
|
+
"Array.prototype.unshift": [0, 19, 38, 41, 78, 193],
|
|
30
|
+
"Math.acosh": [0, 100, 194],
|
|
31
|
+
"Math.asinh": [0, 100, 195],
|
|
32
|
+
"Math.atanh": [0, 100, 196],
|
|
33
|
+
"Math.cbrt": [0, 103, 197],
|
|
34
|
+
"Math.clz32": [0, 198],
|
|
35
|
+
"Math.cosh": [0, 96, 199],
|
|
36
|
+
"Math.expm1": [0, 96, 200],
|
|
37
|
+
"Math.fround": [0, 97, 98, 102, 103, 201],
|
|
38
|
+
"Math.hypot": [0, 202],
|
|
39
|
+
"Math.imul": [0, 203],
|
|
40
|
+
"Math.log10": [0, 99, 204],
|
|
41
|
+
"Math.log1p": [0, 100, 205],
|
|
42
|
+
"Math.log2": [0, 101, 206],
|
|
43
|
+
"Math.sign": [0, 103, 207],
|
|
44
|
+
"Math.sinh": [0, 96, 208],
|
|
45
|
+
"Math.tanh": [0, 96, 209],
|
|
46
|
+
"Math.trunc": [0, 210],
|
|
47
|
+
"Object.assign": [0, 107, 119, 211],
|
|
48
|
+
"Object.create": [0, 71, 108, 109, 119, 212],
|
|
49
|
+
"Object.entries": [0, 30, 115, 119, 122, 213],
|
|
50
|
+
"Object.freeze": [0, 8, 20, 52, 75, 112, 116, 214],
|
|
51
|
+
"Object.fromEntries": [0, 35, 54, 60, 64, 65, 77, 89, 90, 93, 215],
|
|
52
|
+
"Object.getOwnPropertyDescriptor": [0, 216],
|
|
53
|
+
"Object.getOwnPropertyDescriptors": [0, 35, 217],
|
|
54
|
+
"Object.getPrototypeOf": [0, 30, 115, 218],
|
|
55
|
+
"Object.hasOwn": [0, 219],
|
|
56
|
+
"Object.is": [0, 138, 223],
|
|
57
|
+
"Object.isExtensible": [0, 8, 116, 220],
|
|
58
|
+
"Object.isFrozen": [0, 8, 221],
|
|
59
|
+
"Object.isSealed": [0, 8, 222],
|
|
60
|
+
"Object.keys": [0, 119, 224],
|
|
61
|
+
"Object.preventExtensions": [0, 8, 20, 52, 75, 112, 116, 225],
|
|
62
|
+
"Object.seal": [0, 8, 20, 52, 75, 112, 116, 226],
|
|
63
|
+
"Object.setPrototypeOf": [0, 4, 59, 85, 121, 227],
|
|
64
|
+
"Object.values": [0, 30, 115, 119, 122, 228],
|
|
65
|
+
"Promise.any": [0, 25, 48, 54, 60, 64, 65, 77, 89, 90, 93, 105, 125, 126, 127, 128, 230],
|
|
66
|
+
"Promise.withResolvers": [0, 105, 231],
|
|
67
|
+
"Reflect.apply": [0, 53, 232],
|
|
68
|
+
"Reflect.construct": [0, 3, 20, 27, 53, 56, 71, 80, 108, 109, 119, 159, 233],
|
|
69
|
+
"Reflect.deleteProperty": [0, 234],
|
|
70
|
+
"Reflect.get": [0, 30, 81, 115, 237],
|
|
71
|
+
"Reflect.getOwnPropertyDescriptor": [0, 235],
|
|
72
|
+
"Reflect.getPrototypeOf": [0, 30, 115, 236],
|
|
73
|
+
"Reflect.has": [0, 238],
|
|
74
|
+
"Reflect.isExtensible": [0, 8, 116, 239],
|
|
75
|
+
"Reflect.ownKeys": [0, 240],
|
|
76
|
+
"Reflect.preventExtensions": [0, 52, 241],
|
|
77
|
+
"Reflect.setPrototypeOf": [0, 4, 59, 85, 121, 242],
|
|
78
|
+
"String.prototype.codePointAt": [0, 27, 145, 159, 160, 243],
|
|
79
|
+
"String.prototype.endsWith": [0, 27, 29, 60, 87, 106, 159, 160, 244],
|
|
80
|
+
"String.fromCodePoint": [0, 245],
|
|
81
|
+
"String.prototype.includes": [0, 27, 29, 87, 106, 159, 160, 246],
|
|
82
|
+
"String.prototype.isWellFormed": [0, 27, 159, 160, 247],
|
|
83
|
+
"String.prototype.matchAll": [0, 3, 6, 27, 30, 32, 60, 71, 80, 87, 91, 92, 93, 108, 109, 115, 119, 129, 130, 131, 132, 133, 134, 135, 136, 139, 143, 145, 159, 160, 249],
|
|
84
|
+
"String.raw": [0, 27, 159, 160, 250],
|
|
85
|
+
"String.prototype.repeat": [0, 27, 146, 159, 160, 251],
|
|
86
|
+
"String.prototype.replaceAll": [0, 27, 67, 87, 131, 132, 133, 159, 160, 252],
|
|
87
|
+
"String.prototype.startsWith": [0, 27, 29, 60, 87, 106, 159, 160, 253],
|
|
88
|
+
"String.prototype.substr": [0, 27, 159, 160, 254],
|
|
89
|
+
"String.prototype.toWellFormed": [0, 27, 159, 160, 255],
|
|
90
|
+
"String.prototype.trim": [0, 27, 148, 150, 159, 160, 167, 260],
|
|
91
|
+
"String.prototype.trimEnd": [0, 27, 147, 148, 150, 159, 160, 167, 256, 258],
|
|
92
|
+
"String.prototype.trimStart": [0, 27, 148, 149, 150, 159, 160, 167, 257, 259],
|
|
93
|
+
"String.prototype.link": [0, 27, 31, 144, 159, 160, 248],
|
|
94
|
+
"Promise.allSettled": [0, 25, 48, 54, 60, 64, 65, 77, 89, 90, 93, 105, 125, 126, 127, 128, 229, 261],
|
|
95
|
+
"focus-visible": [262]
|
|
91
96
|
},
|
|
92
|
-
"maxSize":
|
|
97
|
+
"maxSize": 163427
|
|
93
98
|
}
|
|
@@ -112,13 +112,6 @@
|
|
|
112
112
|
],
|
|
113
113
|
"corejs": true
|
|
114
114
|
},
|
|
115
|
-
{
|
|
116
|
-
"name": "Array.prototype.includes",
|
|
117
|
-
"modules": [
|
|
118
|
-
"es.array.includes"
|
|
119
|
-
],
|
|
120
|
-
"corejs": true
|
|
121
|
-
},
|
|
122
115
|
{
|
|
123
116
|
"name": "Array.prototype.indexOf",
|
|
124
117
|
"modules": [
|
|
@@ -175,6 +168,30 @@
|
|
|
175
168
|
],
|
|
176
169
|
"corejs": true
|
|
177
170
|
},
|
|
171
|
+
{
|
|
172
|
+
"name": "Array.prototype.toReversed",
|
|
173
|
+
"modules": [
|
|
174
|
+
"es.array.to-reversed",
|
|
175
|
+
"esnext.array.to-reversed"
|
|
176
|
+
],
|
|
177
|
+
"corejs": true
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "Array.prototype.toSorted",
|
|
181
|
+
"modules": [
|
|
182
|
+
"es.array.to-sorted",
|
|
183
|
+
"esnext.array.to-sorted"
|
|
184
|
+
],
|
|
185
|
+
"corejs": true
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "Array.prototype.toSpliced",
|
|
189
|
+
"modules": [
|
|
190
|
+
"es.array.to-spliced",
|
|
191
|
+
"esnext.array.to-spliced"
|
|
192
|
+
],
|
|
193
|
+
"corejs": true
|
|
194
|
+
},
|
|
178
195
|
{
|
|
179
196
|
"name": "Array.prototype.unshift",
|
|
180
197
|
"modules": [
|
|
@@ -436,6 +453,14 @@
|
|
|
436
453
|
],
|
|
437
454
|
"corejs": true
|
|
438
455
|
},
|
|
456
|
+
{
|
|
457
|
+
"name": "Promise.withResolvers",
|
|
458
|
+
"modules": [
|
|
459
|
+
"es.promise.with-resolvers",
|
|
460
|
+
"esnext.promise.with-resolvers"
|
|
461
|
+
],
|
|
462
|
+
"corejs": true
|
|
463
|
+
},
|
|
439
464
|
{
|
|
440
465
|
"name": "Reflect.apply",
|
|
441
466
|
"modules": [
|
|
@@ -541,6 +566,14 @@
|
|
|
541
566
|
],
|
|
542
567
|
"corejs": true
|
|
543
568
|
},
|
|
569
|
+
{
|
|
570
|
+
"name": "String.prototype.isWellFormed",
|
|
571
|
+
"modules": [
|
|
572
|
+
"es.string.is-well-formed",
|
|
573
|
+
"esnext.string.is-well-formed"
|
|
574
|
+
],
|
|
575
|
+
"corejs": true
|
|
576
|
+
},
|
|
544
577
|
{
|
|
545
578
|
"name": "String.prototype.matchAll",
|
|
546
579
|
"modules": [
|
|
@@ -585,6 +618,14 @@
|
|
|
585
618
|
],
|
|
586
619
|
"corejs": true
|
|
587
620
|
},
|
|
621
|
+
{
|
|
622
|
+
"name": "String.prototype.toWellFormed",
|
|
623
|
+
"modules": [
|
|
624
|
+
"es.string.to-well-formed",
|
|
625
|
+
"esnext.string.to-well-formed"
|
|
626
|
+
],
|
|
627
|
+
"corejs": true
|
|
628
|
+
},
|
|
588
629
|
{
|
|
589
630
|
"name": "String.prototype.trim",
|
|
590
631
|
"modules": [
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
// https://www.ecma-international.org/ecma-262/9.0/index.html#sec-punctuators
|
|
8
8
|
// eslint-disable-next-line max-len
|
|
9
9
|
const PUNCTUATOR_REGEX = /(return|case|else|{|\(|\[|\.\.\.|;|,|<|>|<=|>=|==|!=|===|!==|\+|-|\*|%|\*\*|\+\+|--|<<|>>|>>>|&|\||\^|!|~|&&|\|\||\?|:|=|\+=|-=|\*=|%=|\*\*=|<<=|>>=|>>>=|&=|\|=|\^=|=>|\/|\/=|\})$/;
|
|
10
|
-
const WHITESPACE_REGEX = /( |\n|\t)+$/;
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Look backwards from `startPosition` in `content` for an ECMAScript punctuator.
|
|
@@ -19,11 +18,13 @@ const WHITESPACE_REGEX = /( |\n|\t)+$/;
|
|
|
19
18
|
*/
|
|
20
19
|
function hasPunctuatorBefore(content, startPosition) {
|
|
21
20
|
for (let i = startPosition; i > 0; i--) {
|
|
21
|
+
const char = content[i - 1];
|
|
22
|
+
// Skip over any ending whitespace
|
|
23
|
+
if (char === ' ' || char === '\n' || char === '\t') continue;
|
|
24
|
+
|
|
22
25
|
// Try to grab at least 6 characters so we can check for `return`
|
|
23
26
|
const sliceStart = Math.max(0, i - 6);
|
|
24
27
|
const precedingCharacters = content.slice(sliceStart, i);
|
|
25
|
-
// Skip over any ending whitespace
|
|
26
|
-
if (WHITESPACE_REGEX.test(precedingCharacters)) continue;
|
|
27
28
|
// Check if it's a punctuator
|
|
28
29
|
return PUNCTUATOR_REGEX.test(precedingCharacters);
|
|
29
30
|
}
|
|
@@ -56,8 +57,7 @@ function computeTokenLength(content, features) {
|
|
|
56
57
|
const templateLiteralDepth = [];
|
|
57
58
|
|
|
58
59
|
for (let i = 0; i < content.length; i++) {
|
|
59
|
-
const
|
|
60
|
-
const char = twoChars.charAt(0);
|
|
60
|
+
const char = content[i];
|
|
61
61
|
|
|
62
62
|
const isWhitespace = char === ' ' || char === '\n' || char === '\t';
|
|
63
63
|
const isAStringOpenChar = char === `'` || char === '"' || char === '`';
|
|
@@ -71,7 +71,7 @@ function computeTokenLength(content, features) {
|
|
|
71
71
|
// License comments count
|
|
72
72
|
if (isInLicenseComment) totalTokenLength++;
|
|
73
73
|
|
|
74
|
-
if (
|
|
74
|
+
if (char === '*' && content[i + 1] === '/') {
|
|
75
75
|
// License comments count, account for the '/' character we're skipping over
|
|
76
76
|
if (isInLicenseComment) totalTokenLength++;
|
|
77
77
|
// End the comment when we hit the closing sequence
|
|
@@ -83,7 +83,7 @@ function computeTokenLength(content, features) {
|
|
|
83
83
|
// String characters count
|
|
84
84
|
totalTokenLength++;
|
|
85
85
|
|
|
86
|
-
if (stringOpenChar === '`' &&
|
|
86
|
+
if (stringOpenChar === '`' && char === '$' && content[i + 1] === '{') {
|
|
87
87
|
// Start new template literal
|
|
88
88
|
templateLiteralDepth.push('templateBrace');
|
|
89
89
|
isInString = false;
|
|
@@ -119,16 +119,16 @@ function computeTokenLength(content, features) {
|
|
|
119
119
|
}
|
|
120
120
|
} else {
|
|
121
121
|
// We're not in any particular token mode, look for the start of different
|
|
122
|
-
if (
|
|
122
|
+
if (char === '/' && content[i + 1] === '*') {
|
|
123
123
|
// Start the multi-line comment
|
|
124
124
|
isInMultilineComment = true;
|
|
125
125
|
// Check if it's a license comment so we know whether to count it
|
|
126
|
-
isInLicenseComment = content
|
|
126
|
+
isInLicenseComment = content[i + 2] === '!';
|
|
127
127
|
// += 2 because we are processing 2 characters, not just 1
|
|
128
128
|
if (isInLicenseComment) totalTokenLength += 2;
|
|
129
129
|
// Skip over the '*' character since we've already processed it
|
|
130
130
|
i++;
|
|
131
|
-
} else if (
|
|
131
|
+
} else if (char === '/' && content[i + 1] === '/' && features.singlelineComments) {
|
|
132
132
|
// Start the single-line comment
|
|
133
133
|
isInSinglelineComment = true;
|
|
134
134
|
isInMultilineComment = false;
|
|
@@ -16,5 +16,6 @@ export const TraceProcessor: typeof TraceEngine.Processor.TraceProcessor;
|
|
|
16
16
|
export const TraceHandlers: typeof TraceEngine.Handlers.ModelHandlers;
|
|
17
17
|
export const Insights: typeof TraceEngine.Insights;
|
|
18
18
|
export const Helpers: typeof TraceEngine.Helpers;
|
|
19
|
+
export const Types: typeof TraceEngine.Types;
|
|
19
20
|
import * as TraceEngine from '@paulirish/trace_engine';
|
|
20
21
|
//# sourceMappingURL=trace-engine.d.ts.map
|
package/core/lib/trace-engine.js
CHANGED
|
@@ -12,10 +12,12 @@ const TraceProcessor = TraceEngine.Processor.TraceProcessor;
|
|
|
12
12
|
const TraceHandlers = TraceEngine.Handlers.ModelHandlers;
|
|
13
13
|
const Insights = TraceEngine.Insights;
|
|
14
14
|
const Helpers = TraceEngine.Helpers;
|
|
15
|
+
const Types = TraceEngine.Types;
|
|
15
16
|
|
|
16
17
|
export {
|
|
17
18
|
TraceProcessor,
|
|
18
19
|
TraceHandlers,
|
|
19
20
|
Insights,
|
|
20
21
|
Helpers,
|
|
22
|
+
Types,
|
|
21
23
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.5.0-dev.
|
|
4
|
+
"version": "13.5.0-dev.20261008",
|
|
5
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
6
6
|
"main": "./core/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"webtreemap-cdt": "^3.2.1"
|
|
184
184
|
},
|
|
185
185
|
"dependencies": {
|
|
186
|
-
"@paulirish/trace_engine": "0.0.
|
|
186
|
+
"@paulirish/trace_engine": "0.0.66",
|
|
187
187
|
"@sentry/node": "^10.0.0",
|
|
188
188
|
"ajv": "^8.20.0",
|
|
189
189
|
"ajv-formats": "^3.0.1",
|