@projectwallace/css-analyzer 7.4.0 → 7.5.0
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/dist/css-analyzer.js +246 -244
- package/dist/index.d.ts +15 -2
- package/package.json +1 -1
package/dist/css-analyzer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import $t from "css-tree/parser";
|
|
2
2
|
import q from "css-tree/walker";
|
|
3
|
-
import { calculateForAST as
|
|
4
|
-
function
|
|
3
|
+
import { calculateForAST as ei } from "@bramus/specificity/core";
|
|
4
|
+
function He(r, t) {
|
|
5
5
|
return t >= 65 && t <= 90 && (t = t | 32), r === t;
|
|
6
6
|
}
|
|
7
7
|
function S(r, t) {
|
|
@@ -9,47 +9,47 @@ function S(r, t) {
|
|
|
9
9
|
let s = r.length;
|
|
10
10
|
if (s !== t.length) return !1;
|
|
11
11
|
for (let e = 0; e < s; e++)
|
|
12
|
-
if (
|
|
12
|
+
if (He(r.charCodeAt(e), t.charCodeAt(e)) === !1)
|
|
13
13
|
return !1;
|
|
14
14
|
return !0;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function O(r, t) {
|
|
17
17
|
if (r === t) return !0;
|
|
18
18
|
let s = t.length, e = s - r.length;
|
|
19
19
|
if (e < 0)
|
|
20
20
|
return !1;
|
|
21
21
|
for (let n = s - 1; n >= e; n--)
|
|
22
|
-
if (
|
|
22
|
+
if (He(r.charCodeAt(n - e), t.charCodeAt(n)) === !1)
|
|
23
23
|
return !1;
|
|
24
24
|
return !0;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function We(r, t) {
|
|
27
27
|
if (r === t) return !0;
|
|
28
28
|
let s = r.length;
|
|
29
29
|
if (t.length < s) return !1;
|
|
30
30
|
for (let e = 0; e < s; e++)
|
|
31
|
-
if (
|
|
31
|
+
if (He(r.charCodeAt(e), t.charCodeAt(e)) === !1)
|
|
32
32
|
return !1;
|
|
33
33
|
return !0;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
35
|
+
const Te = "Atrule", ti = "MediaQuery", Me = "Rule", Ke = "Selector", Kt = "TypeSelector", G = "PseudoClassSelector", Nt = "AttributeSelector", jt = "PseudoElementSelector", Ve = "Declaration", ii = "Value", R = "Identifier", ri = "Nth", si = "Combinator", Bt = "Number", Ne = "Dimension", W = "Operator", li = "Hash", ni = "Url", je = "Function";
|
|
36
|
+
function It(r, t, s) {
|
|
37
37
|
let e = r.value.children.first;
|
|
38
|
-
return S(t, r.property) && e.type ===
|
|
38
|
+
return S(t, r.property) && e.type === R && S(s, e.name);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ai(r) {
|
|
41
41
|
let t = !1;
|
|
42
42
|
return q(r, function(s) {
|
|
43
|
-
if (s.type ===
|
|
43
|
+
if (s.type === Ve && (It(s, "-webkit-appearance", "none") || It(s, "-moz-appearance", "meterbar")))
|
|
44
44
|
return t = !0, this.break;
|
|
45
45
|
}), t;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function oi(r) {
|
|
48
48
|
let t = !1;
|
|
49
49
|
return q(r, function(s) {
|
|
50
50
|
let e = s.name, n = s.value;
|
|
51
|
-
if (s.type ===
|
|
52
|
-
if (
|
|
51
|
+
if (s.type === ti && s.mediaType !== null) {
|
|
52
|
+
if (We("\\0", s.mediaType) || O("\\9 ", s.mediaType))
|
|
53
53
|
return t = !0, this.break;
|
|
54
54
|
} else if (s.type === "Feature" && s.kind === "media") {
|
|
55
55
|
if (n && n.unit && n.unit === "\\0")
|
|
@@ -63,9 +63,9 @@ function ai(r) {
|
|
|
63
63
|
}
|
|
64
64
|
}), t;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const Ut = 45;
|
|
67
67
|
function F(r) {
|
|
68
|
-
return r.charCodeAt(0) ===
|
|
68
|
+
return r.charCodeAt(0) === Ut && r.charCodeAt(1) !== Ut && r.indexOf("-", 2) !== -1;
|
|
69
69
|
}
|
|
70
70
|
class A {
|
|
71
71
|
/** @param {string[]} items */
|
|
@@ -77,16 +77,16 @@ class A {
|
|
|
77
77
|
return this.set.has(t.toLowerCase());
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Yt(r, t) {
|
|
81
81
|
let s = [];
|
|
82
82
|
return q(r, {
|
|
83
|
-
visit:
|
|
83
|
+
visit: Ke,
|
|
84
84
|
enter: function(e) {
|
|
85
85
|
s.push(t(e));
|
|
86
86
|
}
|
|
87
87
|
}), s;
|
|
88
88
|
}
|
|
89
|
-
const
|
|
89
|
+
const Gt = new A([
|
|
90
90
|
"nth-child",
|
|
91
91
|
"where",
|
|
92
92
|
"not",
|
|
@@ -97,15 +97,15 @@ const Yt = new A([
|
|
|
97
97
|
"-webkit-any",
|
|
98
98
|
"-moz-any"
|
|
99
99
|
]);
|
|
100
|
-
function
|
|
100
|
+
function Qt(r) {
|
|
101
101
|
let t = !1;
|
|
102
102
|
return q(r, function(s) {
|
|
103
|
-
if (s.type ===
|
|
103
|
+
if (s.type === Nt) {
|
|
104
104
|
let e = s.name.name;
|
|
105
|
-
if (S("role", e) ||
|
|
105
|
+
if (S("role", e) || We("aria-", e))
|
|
106
106
|
return t = !0, this.break;
|
|
107
|
-
} else if (s.type === G &&
|
|
108
|
-
let e =
|
|
107
|
+
} else if (s.type === G && Gt.has(s.name)) {
|
|
108
|
+
let e = Yt(s, Qt);
|
|
109
109
|
for (let n of e)
|
|
110
110
|
if (n === !0) {
|
|
111
111
|
t = !0;
|
|
@@ -115,29 +115,29 @@ function Gt(r) {
|
|
|
115
115
|
}
|
|
116
116
|
}), t;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function ui(r) {
|
|
119
119
|
let t = !1;
|
|
120
120
|
return q(r, function(s) {
|
|
121
121
|
let e = s.type;
|
|
122
|
-
if ((e ===
|
|
122
|
+
if ((e === jt || e === Kt || e === G) && F(s.name))
|
|
123
123
|
return t = !0, this.break;
|
|
124
124
|
}), t;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function ci(r) {
|
|
127
127
|
let t = [];
|
|
128
128
|
return q(r, function(s) {
|
|
129
129
|
s.type === G && t.push(s.name);
|
|
130
130
|
}), t.length === 0 ? !1 : t;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Zt(r) {
|
|
133
133
|
let t = 0;
|
|
134
134
|
return q(r, function(s) {
|
|
135
135
|
let e = s.type;
|
|
136
|
-
if (!(e ===
|
|
137
|
-
if (t++, (e ===
|
|
136
|
+
if (!(e === Ke || e === ri)) {
|
|
137
|
+
if (t++, (e === jt || e === Kt || e === G) && F(s.name) && t++, e === Nt)
|
|
138
138
|
return s.value && t++, this.skip;
|
|
139
|
-
if (e === G &&
|
|
140
|
-
let n =
|
|
139
|
+
if (e === G && Gt.has(s.name)) {
|
|
140
|
+
let n = Yt(s, Zt);
|
|
141
141
|
if (n.length === 0) return;
|
|
142
142
|
for (let a of n)
|
|
143
143
|
t += a;
|
|
@@ -146,9 +146,9 @@ function Qt(r) {
|
|
|
146
146
|
}
|
|
147
147
|
}), t;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function fi(r, t) {
|
|
150
150
|
q(r, function(s, e) {
|
|
151
|
-
if (s.type ===
|
|
151
|
+
if (s.type === si) {
|
|
152
152
|
let n = s.loc, a = s.name;
|
|
153
153
|
if (n === null) {
|
|
154
154
|
let y = e.prev.data.loc.end, k = {
|
|
@@ -175,7 +175,7 @@ function ci(r, t) {
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const pi = new A([
|
|
179
179
|
// CSS Named Colors
|
|
180
180
|
// Spec: https://drafts.csswg.org/css-color/#named-colors
|
|
181
181
|
// Heuristic: popular names first for quick finding in set.has()
|
|
@@ -328,7 +328,7 @@ const fi = new A([
|
|
|
328
328
|
"mediumorchid",
|
|
329
329
|
"darksalmon",
|
|
330
330
|
"mediumspringgreen"
|
|
331
|
-
]),
|
|
331
|
+
]), hi = new A([
|
|
332
332
|
// CSS System Colors
|
|
333
333
|
// Spec: https://drafts.csswg.org/css-color/#css-system-colors
|
|
334
334
|
"accentcolor",
|
|
@@ -350,7 +350,7 @@ const fi = new A([
|
|
|
350
350
|
"selecteditem",
|
|
351
351
|
"selecteditemtext",
|
|
352
352
|
"visitedtext"
|
|
353
|
-
]),
|
|
353
|
+
]), mi = new A([
|
|
354
354
|
"rgba",
|
|
355
355
|
"rgb",
|
|
356
356
|
"hsla",
|
|
@@ -361,7 +361,7 @@ const fi = new A([
|
|
|
361
361
|
"lch",
|
|
362
362
|
"lab",
|
|
363
363
|
"oklab"
|
|
364
|
-
]),
|
|
364
|
+
]), gi = new A([
|
|
365
365
|
"transparent",
|
|
366
366
|
"currentcolor"
|
|
367
367
|
]), ie = new A([
|
|
@@ -378,25 +378,25 @@ function te(r) {
|
|
|
378
378
|
let t = r.children, s = t.size;
|
|
379
379
|
if (!t || s > 1 || s === 0) return !1;
|
|
380
380
|
let e = t.first;
|
|
381
|
-
return e.type ===
|
|
381
|
+
return e.type === R && ie.has(e.name);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Vt(r) {
|
|
384
384
|
return parseFloat(r) === 0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function di(r) {
|
|
387
387
|
for (let t of r.children.toArray())
|
|
388
|
-
if (!(t.type ===
|
|
388
|
+
if (!(t.type === Bt && Vt(t.value)) && !(t.type === Ne && Vt(t.value)))
|
|
389
389
|
return !1;
|
|
390
390
|
return !0;
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const yi = new A([
|
|
393
393
|
"caption",
|
|
394
394
|
"icon",
|
|
395
395
|
"menu",
|
|
396
396
|
"message-box",
|
|
397
397
|
"small-caption",
|
|
398
398
|
"status-bar"
|
|
399
|
-
]),
|
|
399
|
+
]), wi = new A([
|
|
400
400
|
/* <absolute-size> values */
|
|
401
401
|
"xx-small",
|
|
402
402
|
"x-small",
|
|
@@ -409,39 +409,39 @@ const di = new A([
|
|
|
409
409
|
/* <relative-size> values */
|
|
410
410
|
"smaller",
|
|
411
411
|
"larger"
|
|
412
|
-
]),
|
|
413
|
-
function
|
|
412
|
+
]), bi = 44, Ht = 47;
|
|
413
|
+
function Ie(r) {
|
|
414
414
|
let t = r.children.first;
|
|
415
|
-
return t === null ? !1 : t.type ===
|
|
415
|
+
return t === null ? !1 : t.type === R && yi.has(t.name);
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ki(r, t, s) {
|
|
418
418
|
var k;
|
|
419
419
|
let e = Array.from({ length: 2 }), n, a;
|
|
420
420
|
r.children.forEach(function(w, _) {
|
|
421
421
|
let b = _.prev ? _.prev.data : void 0, P = _.next ? _.next.data : void 0;
|
|
422
|
-
if (w.type ===
|
|
422
|
+
if (w.type === R && ie.has(w.name) && s({
|
|
423
423
|
type: "keyword",
|
|
424
424
|
value: w.name
|
|
425
|
-
}), P && P.type === W && P.value.charCodeAt(0) ===
|
|
425
|
+
}), P && P.type === W && P.value.charCodeAt(0) === Ht) {
|
|
426
426
|
n = t(w);
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
if (b && b.type === W && b.value.charCodeAt(0) ===
|
|
429
|
+
if (b && b.type === W && b.value.charCodeAt(0) === Ht) {
|
|
430
430
|
a = t(w);
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
|
-
if (P && P.type === W && P.value.charCodeAt(0) ===
|
|
433
|
+
if (P && P.type === W && P.value.charCodeAt(0) === bi && !e[0]) {
|
|
434
434
|
e[0] = w, !n && b && (n = t(b));
|
|
435
435
|
return;
|
|
436
436
|
}
|
|
437
|
-
if (w.type !==
|
|
437
|
+
if (w.type !== Bt) {
|
|
438
438
|
if (_.next === null) {
|
|
439
439
|
e[1] = w, !n && !e[0] && b && (n = t(b));
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
if (w.type ===
|
|
442
|
+
if (w.type === R) {
|
|
443
443
|
let D = w.name;
|
|
444
|
-
if (
|
|
444
|
+
if (wi.has(D)) {
|
|
445
445
|
n = D;
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
@@ -466,7 +466,7 @@ function bi(r, t, s) {
|
|
|
466
466
|
font_family: y
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
const
|
|
469
|
+
const xi = new A([
|
|
470
470
|
"linear",
|
|
471
471
|
"ease",
|
|
472
472
|
"ease-in",
|
|
@@ -474,36 +474,36 @@ const ki = new A([
|
|
|
474
474
|
"ease-in-out",
|
|
475
475
|
"step-start",
|
|
476
476
|
"step-end"
|
|
477
|
-
]),
|
|
477
|
+
]), Ci = new A([
|
|
478
478
|
"cubic-bezier",
|
|
479
479
|
"steps"
|
|
480
480
|
]);
|
|
481
|
-
function
|
|
481
|
+
function zi(r, t) {
|
|
482
482
|
let s = !1;
|
|
483
483
|
for (let e of r) {
|
|
484
484
|
let n = e.type, a = e.name;
|
|
485
|
-
n === W ? s = !1 : n ===
|
|
485
|
+
n === W ? s = !1 : n === Ne && s === !1 ? (s = !0, t({
|
|
486
486
|
type: "duration",
|
|
487
487
|
value: e
|
|
488
|
-
})) : n ===
|
|
488
|
+
})) : n === R ? xi.has(a) ? t({
|
|
489
489
|
type: "fn",
|
|
490
490
|
value: e
|
|
491
491
|
}) : ie.has(a) && t({
|
|
492
492
|
type: "keyword",
|
|
493
493
|
value: e
|
|
494
|
-
}) : n ===
|
|
494
|
+
}) : n === je && Ci.has(a) && t({
|
|
495
495
|
type: "fn",
|
|
496
496
|
value: e
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Jt(r) {
|
|
501
501
|
let t = r.children;
|
|
502
502
|
if (!t)
|
|
503
503
|
return !1;
|
|
504
504
|
for (let s of t) {
|
|
505
505
|
let { type: e, name: n } = s;
|
|
506
|
-
if (e ===
|
|
506
|
+
if (e === R && F(n) || e === je && (F(n) || Jt(s)))
|
|
507
507
|
return !0;
|
|
508
508
|
}
|
|
509
509
|
return !1;
|
|
@@ -576,7 +576,7 @@ class o {
|
|
|
576
576
|
return e && (w.uniqueWithLocations = Object.fromEntries(t)), w;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
class
|
|
579
|
+
class Ue {
|
|
580
580
|
/** @param {boolean} useLocations */
|
|
581
581
|
constructor(t) {
|
|
582
582
|
this._list = new o(t), this._contexts = /* @__PURE__ */ new Map(), this._useLocations = t;
|
|
@@ -599,7 +599,7 @@ class Ve {
|
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Si(r) {
|
|
603
603
|
let t = /* @__PURE__ */ new Map(), s = -1, e = 0, n = 0, a = r.length;
|
|
604
604
|
for (let y = 0; y < a; y++) {
|
|
605
605
|
let k = r[y], w = (t.get(k) || 0) + 1;
|
|
@@ -632,7 +632,7 @@ class C {
|
|
|
632
632
|
range: 0,
|
|
633
633
|
sum: 0
|
|
634
634
|
};
|
|
635
|
-
let s = this._items.slice().sort((k, w) => k - w), e = s[0], n = s[t - 1], a =
|
|
635
|
+
let s = this._items.slice().sort((k, w) => k - w), e = s[0], n = s[t - 1], a = Si(s), y = this._sum;
|
|
636
636
|
return {
|
|
637
637
|
min: e,
|
|
638
638
|
max: n,
|
|
@@ -649,33 +649,33 @@ class C {
|
|
|
649
649
|
return this._items;
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
if (
|
|
652
|
+
function _i(r) {
|
|
653
|
+
if (Be(r) || F(r)) return !1;
|
|
654
654
|
let t = r.charCodeAt(0);
|
|
655
655
|
return t === 47 || t === 42 || t === 95 || t === 43 || t === 38 || t === 36 || t === 35;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Be(r) {
|
|
658
658
|
return r.length < 3 ? !1 : r.charCodeAt(0) === 45 && r.charCodeAt(1) === 45;
|
|
659
659
|
}
|
|
660
660
|
function m(r, t) {
|
|
661
|
-
return
|
|
661
|
+
return Be(t) ? !1 : O(r, t);
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function vi(r) {
|
|
664
664
|
return F(r) ? r.slice(r.indexOf("-", 2) + 1) : r;
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function qi(r) {
|
|
667
667
|
let t = 5, s = r.indexOf(";"), e = r.indexOf(",");
|
|
668
668
|
return s === -1 || e !== -1 && e < s ? r.substring(t, e) : r.substring(t, s);
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Ai(r) {
|
|
671
671
|
let t = r.children;
|
|
672
672
|
if (t) {
|
|
673
673
|
let s = t.last;
|
|
674
|
-
return s && s.type ===
|
|
674
|
+
return s && s.type === R && O("\\9", s.name);
|
|
675
675
|
}
|
|
676
676
|
return !1;
|
|
677
677
|
}
|
|
678
|
-
let
|
|
678
|
+
let Pi = new A([
|
|
679
679
|
"border-radius",
|
|
680
680
|
"border-top-left-radius",
|
|
681
681
|
"border-top-right-radius",
|
|
@@ -689,11 +689,11 @@ let Ai = new A([
|
|
|
689
689
|
function z(r, t) {
|
|
690
690
|
return t === 0 ? 0 : r / t;
|
|
691
691
|
}
|
|
692
|
-
let
|
|
692
|
+
let Li = {
|
|
693
693
|
useLocations: !1
|
|
694
694
|
};
|
|
695
|
-
function
|
|
696
|
-
let e = Object.assign({},
|
|
695
|
+
function Ei(r, t = {}) {
|
|
696
|
+
let e = Object.assign({}, Li, t).useLocations === !0, n = Date.now();
|
|
697
697
|
function a(i) {
|
|
698
698
|
return y(i).trim();
|
|
699
699
|
}
|
|
@@ -705,7 +705,7 @@ function Di(r, t = {}) {
|
|
|
705
705
|
total: 0,
|
|
706
706
|
/** @type {Map<string, { size: number, count: number } & ({ uniqueWithLocations?: undefined } | ({ uniqueWithLocations: { offset: number, line: number, column: number, length: number }[] })) }>} */
|
|
707
707
|
unique: /* @__PURE__ */ new Map()
|
|
708
|
-
}, P = Date.now(), D =
|
|
708
|
+
}, P = Date.now(), D = $t(r, {
|
|
709
709
|
parseCustomProperty: !0,
|
|
710
710
|
// To find font-families, colors, etc.
|
|
711
711
|
positions: !0,
|
|
@@ -714,36 +714,36 @@ function Di(r, t = {}) {
|
|
|
714
714
|
onComment: function(i) {
|
|
715
715
|
k++, w += i.length;
|
|
716
716
|
}
|
|
717
|
-
}), T = Date.now(),
|
|
717
|
+
}), T = Date.now(), Xt = D.loc.end.line - D.loc.start.line + 1, Ye = new o(e), re = new C(), se = [], Ge = new o(e), le = new o(e), Qe = new o(e), Ze = new o(e), Je = new o(e), Xe = new o(e), $e = new o(e), ne = new o(e), et = new o(e), ae = new o(e), oe = new o(e), tt = new o(e), Q = new o(e), it = new o(e), ue = new C(), rt = new o(e), ce = 0, fe = 0, pe = new C(), he = new C(), me = new C(), st = new o(e), lt = new o(e), nt = new o(e), ge = new C(), at = new o(e), de = new o(e), ot = /* @__PURE__ */ new Set(), ye = new o(e), M, I, ut = new C(), ct = new C(), ft = new C(), pt = new o(e), Z = new C(), ht = new o(e), mt = [], we = new o(e), be = new o(e), gt = new o(e), dt = new o(e), ke = new C(), yt = new o(e), wt = /* @__PURE__ */ new Set(), K = 0, bt = new C(), J = 0, xe = 0, Ce = new o(e), ze = new C(), kt = new o(e), N = new o(e), Se = new o(e), _e = new o(e), X = new o(e), j = new C(), ve = new C(), xt = new o(e), qe = new o(e), Ct = new o(e), zt = new o(e), St = new o(e), Ae = new o(e), Pe = new o(e), Le = new o(e), $ = new o(e), ee = new o(e), U = new Ue(e), V = new o(e), Oe = new Ue(e), _t = new o(e), B = new o(e), vt = new Ue(e), qt = new o(e), L = 0;
|
|
718
718
|
q(D, {
|
|
719
719
|
enter(i) {
|
|
720
|
-
var Y,
|
|
720
|
+
var Y, Mt;
|
|
721
721
|
switch (i.type) {
|
|
722
|
-
case
|
|
723
|
-
|
|
722
|
+
case Te: {
|
|
723
|
+
Ye.p(i.name, i.loc), ue.push(L), rt.p(L, i.loc);
|
|
724
724
|
let p = i.name;
|
|
725
725
|
if (p === "font-face") {
|
|
726
726
|
let g = {};
|
|
727
727
|
e && Ge.p(i.loc.start.offset, i.loc), i.block.children.forEach((c) => {
|
|
728
|
-
c.type ===
|
|
729
|
-
}),
|
|
728
|
+
c.type === Ve && (g[c.property] = a(c.value));
|
|
729
|
+
}), se.push(g), re.push(1);
|
|
730
730
|
break;
|
|
731
731
|
}
|
|
732
732
|
let l = 1;
|
|
733
733
|
if (i.prelude !== null) {
|
|
734
734
|
let g = i.prelude, c = g && a(i.prelude), f = g.loc;
|
|
735
735
|
if (p === "media")
|
|
736
|
-
Ze.p(c, f),
|
|
736
|
+
Ze.p(c, f), oi(g) && (Je.p(c, f), l++);
|
|
737
737
|
else if (p === "supports")
|
|
738
|
-
|
|
739
|
-
else if (
|
|
738
|
+
ne.p(c, f), ai(g) && (et.p(c, f), l++);
|
|
739
|
+
else if (O("keyframes", p)) {
|
|
740
740
|
let u = "@" + p + " " + c;
|
|
741
|
-
F(p) && (
|
|
741
|
+
F(p) && (oe.p(u, f), l++), ae.p(u, f);
|
|
742
742
|
} else if (p === "import")
|
|
743
743
|
q(i, function(u) {
|
|
744
744
|
if (u.type === "Condition" && u.kind === "supports") {
|
|
745
745
|
let h = a(u);
|
|
746
|
-
return
|
|
746
|
+
return ne.p(h, u.loc), this.break;
|
|
747
747
|
}
|
|
748
748
|
}), Qe.p(c, f);
|
|
749
749
|
else if (p === "charset")
|
|
@@ -755,48 +755,48 @@ function Di(r, t = {}) {
|
|
|
755
755
|
}
|
|
756
756
|
} else p === "property" && it.p(c, f);
|
|
757
757
|
} else
|
|
758
|
-
p === "layer" && (
|
|
759
|
-
|
|
758
|
+
p === "layer" && (le.p("<anonymous>", i.loc), l++);
|
|
759
|
+
re.push(l);
|
|
760
760
|
break;
|
|
761
761
|
}
|
|
762
762
|
case "Layer": {
|
|
763
|
-
i.name !== null &&
|
|
763
|
+
i.name !== null && le.p(i.name, i.loc);
|
|
764
764
|
break;
|
|
765
765
|
}
|
|
766
766
|
case "Feature": {
|
|
767
767
|
Xe.p(i.name, i.loc);
|
|
768
768
|
break;
|
|
769
769
|
}
|
|
770
|
-
case
|
|
770
|
+
case Me: {
|
|
771
771
|
let p = i.prelude, l = i.block, g = p.children, c = l.children, f = g ? g.size : 0, u = c ? c.size : 0;
|
|
772
|
-
|
|
772
|
+
pe.push(f + u), st.p(f + u, i.loc), he.push(f), lt.p(f, p.loc), me.push(u), nt.p(u, l.loc), ge.push(L), at.p(L, i.loc), ce++, u === 0 && fe++;
|
|
773
773
|
break;
|
|
774
774
|
}
|
|
775
|
-
case
|
|
775
|
+
case Ke: {
|
|
776
776
|
let p = a(i);
|
|
777
|
-
if (this.atrule &&
|
|
778
|
-
return
|
|
779
|
-
|
|
780
|
-
let l =
|
|
777
|
+
if (this.atrule && O("keyframes", this.atrule.name))
|
|
778
|
+
return de.p(p, i.loc), this.skip;
|
|
779
|
+
Qt(i) && be.p(p, i.loc);
|
|
780
|
+
let l = ci(i);
|
|
781
781
|
if (l !== !1)
|
|
782
782
|
for (let x of l)
|
|
783
783
|
gt.p(x, i.loc);
|
|
784
|
-
let g =
|
|
785
|
-
|
|
786
|
-
let c =
|
|
787
|
-
return pt.p(c.toString(), i.loc), ut.push(f), ct.push(u), ft.push(h), M === void 0 && (M = c), I === void 0 && (I = c), I !== void 0 &&
|
|
784
|
+
let g = Zt(i);
|
|
785
|
+
ui(i) && ye.p(p, i.loc), ot.add(p), Z.push(g), ht.p(g, i.loc), ke.push(L - 1), yt.p(L - 1, i.loc);
|
|
786
|
+
let c = ei(i).toArray(), [f, u, h] = c;
|
|
787
|
+
return pt.p(c.toString(), i.loc), ut.push(f), ct.push(u), ft.push(h), M === void 0 && (M = c), I === void 0 && (I = c), I !== void 0 && Wt(I, c) < 0 && (I = c), M !== void 0 && Wt(M, c) > 0 && (M = c), mt.push(c), f > 0 && we.p(p, i.loc), fi(i, function(v) {
|
|
788
788
|
dt.p(v.name, v.loc);
|
|
789
789
|
}), this.skip;
|
|
790
790
|
}
|
|
791
|
-
case
|
|
791
|
+
case Ne: {
|
|
792
792
|
if (!this.declaration)
|
|
793
793
|
break;
|
|
794
794
|
let p = i.unit;
|
|
795
|
-
return
|
|
795
|
+
return O("\\9", p) ? Oe.push(p.substring(0, p.length - 2), this.declaration.property, i.loc) : Oe.push(p, this.declaration.property, i.loc), this.skip;
|
|
796
796
|
}
|
|
797
|
-
case
|
|
798
|
-
if (
|
|
799
|
-
let p = i.value, l = p.length, g =
|
|
797
|
+
case ni: {
|
|
798
|
+
if (We("data:", i.value)) {
|
|
799
|
+
let p = i.value, l = p.length, g = qi(p);
|
|
800
800
|
b.total++, _ += l;
|
|
801
801
|
let c = {
|
|
802
802
|
/** @type {number} */
|
|
@@ -821,36 +821,36 @@ function Di(r, t = {}) {
|
|
|
821
821
|
}
|
|
822
822
|
break;
|
|
823
823
|
}
|
|
824
|
-
case
|
|
824
|
+
case ii: {
|
|
825
825
|
if (te(i)) {
|
|
826
|
-
|
|
826
|
+
ve.push(1), B.p(a(i), i.loc);
|
|
827
827
|
break;
|
|
828
828
|
}
|
|
829
829
|
let p = this.declaration, { property: l, important: g } = p, c = 1;
|
|
830
|
-
|
|
830
|
+
Jt(i) && (xt.p(a(i), i.loc), c++), typeof g == "string" && (qe.p(y(i) + "!" + g, i.loc), c++), Ai(i) && (qe.p(a(i), i.loc), c++);
|
|
831
831
|
let f = i.children, u = i.loc;
|
|
832
|
-
if (
|
|
833
|
-
|
|
832
|
+
if (ve.push(c), m("margin", l) || m("margin-block", l) || m("margin-inline", l) || m("margin-top", l) || m("margin-right", l) || m("margin-bottom", l) || m("margin-left", l) || m("padding", l) || m("padding-block", l) || m("padding-inline", l) || m("padding-top", l) || m("padding-right", l) || m("padding-bottom", l) || m("padding-left", l))
|
|
833
|
+
di(i) && qt.p(l, p.loc);
|
|
834
834
|
else {
|
|
835
835
|
if (m("z-index", l))
|
|
836
836
|
return Ct.p(a(i), u), this.skip;
|
|
837
837
|
if (m("font", l)) {
|
|
838
|
-
if (
|
|
839
|
-
let { font_size: h, line_height: x, font_family: v } =
|
|
838
|
+
if (Ie(i)) return;
|
|
839
|
+
let { font_size: h, line_height: x, font_family: v } = ki(i, a, function(E) {
|
|
840
840
|
E.type === "keyword" && B.p(E.value, u);
|
|
841
841
|
});
|
|
842
|
-
v &&
|
|
842
|
+
v && Ae.p(v, u), h && Pe.p(h, u), x && Le.p(x, u);
|
|
843
843
|
break;
|
|
844
844
|
} else if (m("font-size", l)) {
|
|
845
|
-
|
|
845
|
+
Ie(i) || Pe.p(a(i), u);
|
|
846
846
|
break;
|
|
847
847
|
} else if (m("font-family", l)) {
|
|
848
|
-
|
|
848
|
+
Ie(i) || Ae.p(a(i), u);
|
|
849
849
|
break;
|
|
850
850
|
} else if (m("line-height", l))
|
|
851
|
-
|
|
851
|
+
Le.p(a(i), u);
|
|
852
852
|
else if (m("transition", l) || m("animation", l)) {
|
|
853
|
-
|
|
853
|
+
zi(f, function(h) {
|
|
854
854
|
h.type === "fn" ? $.p(a(h.value), u) : h.type === "duration" ? ee.p(a(h.value), u) : h.type === "keyword" && B.p(a(h.value), u);
|
|
855
855
|
});
|
|
856
856
|
break;
|
|
@@ -867,8 +867,8 @@ function Di(r, t = {}) {
|
|
|
867
867
|
} else if (m("container-name", l))
|
|
868
868
|
Q.p(a(i), u);
|
|
869
869
|
else if (m("container", l))
|
|
870
|
-
((
|
|
871
|
-
else if (
|
|
870
|
+
((Mt = f.first) == null ? void 0 : Mt.type) === "Identifier" && Q.p(f.first.name, u);
|
|
871
|
+
else if (Pi.has(vi(l))) {
|
|
872
872
|
te(i) || vt.push(a(i), l, u);
|
|
873
873
|
break;
|
|
874
874
|
} else m("text-shadow", l) ? te(i) || zt.p(a(i), u) : m("box-shadow", l) && (te(i) || St.p(a(i), u));
|
|
@@ -876,40 +876,40 @@ function Di(r, t = {}) {
|
|
|
876
876
|
q(i, function(h) {
|
|
877
877
|
let x = h.name;
|
|
878
878
|
switch (h.type) {
|
|
879
|
-
case
|
|
879
|
+
case li: {
|
|
880
880
|
let v = h.value.length;
|
|
881
|
-
return
|
|
881
|
+
return O("\\9", h.value) && (v = v - 2), U.push("#" + h.value, l, u), V.p("hex" + v, u), this.skip;
|
|
882
882
|
}
|
|
883
|
-
case
|
|
883
|
+
case R: {
|
|
884
884
|
ie.has(x) && B.p(x, u);
|
|
885
885
|
let v = x.length;
|
|
886
886
|
if (v > 20 || v < 3)
|
|
887
887
|
return this.skip;
|
|
888
|
-
if (
|
|
888
|
+
if (gi.has(x)) {
|
|
889
889
|
let E = a(h);
|
|
890
890
|
U.push(E, l, u), V.p(x.toLowerCase(), u);
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
893
|
-
if (
|
|
893
|
+
if (pi.has(x)) {
|
|
894
894
|
let E = a(h);
|
|
895
895
|
U.push(E, l, u), V.p("named", u);
|
|
896
896
|
return;
|
|
897
897
|
}
|
|
898
|
-
if (
|
|
898
|
+
if (hi.has(x)) {
|
|
899
899
|
let E = a(h);
|
|
900
900
|
U.push(E, l, u), V.p("system", u);
|
|
901
901
|
return;
|
|
902
902
|
}
|
|
903
903
|
return this.skip;
|
|
904
904
|
}
|
|
905
|
-
case
|
|
905
|
+
case je: {
|
|
906
906
|
if (S("var", x))
|
|
907
907
|
return this.skip;
|
|
908
|
-
if (
|
|
908
|
+
if (mi.has(x)) {
|
|
909
909
|
U.push(a(h), l, h.loc), V.p(x.toLowerCase(), h.loc);
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
if (
|
|
912
|
+
if (O("gradient", x)) {
|
|
913
913
|
_t.p(a(h), h.loc);
|
|
914
914
|
return;
|
|
915
915
|
}
|
|
@@ -918,12 +918,12 @@ function Di(r, t = {}) {
|
|
|
918
918
|
});
|
|
919
919
|
break;
|
|
920
920
|
}
|
|
921
|
-
case
|
|
921
|
+
case Ve: {
|
|
922
922
|
if (this.atrulePrelude !== null)
|
|
923
923
|
return this.skip;
|
|
924
924
|
K++;
|
|
925
925
|
let p = 1;
|
|
926
|
-
wt.add(a(i)),
|
|
926
|
+
wt.add(a(i)), ze.push(L - 1), kt.p(L - 1, i.loc), i.important === !0 && (J++, p++, this.atrule && O("keyframes", this.atrule.name) && (xe++, p++)), bt.push(p);
|
|
927
927
|
let { property: l, loc: { start: g } } = i, c = {
|
|
928
928
|
start: {
|
|
929
929
|
line: g.line,
|
|
@@ -934,23 +934,23 @@ function Di(r, t = {}) {
|
|
|
934
934
|
offset: g.offset + l.length
|
|
935
935
|
}
|
|
936
936
|
};
|
|
937
|
-
N.p(l, c), F(l) ? (
|
|
937
|
+
N.p(l, c), F(l) ? (_e.p(l, c), j.push(2)) : _i(l) ? (Se.p(l, c), j.push(2)) : Be(l) ? (X.p(l, c), j.push(i.important ? 3 : 2), i.important === !0 && Ce.p(l, c)) : j.push(1);
|
|
938
938
|
break;
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
|
-
(i.type ===
|
|
941
|
+
(i.type === Me || i.type === Te) && L++;
|
|
942
942
|
},
|
|
943
943
|
leave(i) {
|
|
944
|
-
(i.type ===
|
|
944
|
+
(i.type === Me || i.type === Te) && L--;
|
|
945
945
|
}
|
|
946
946
|
});
|
|
947
|
-
let At = wt.size, H = Z.size(),
|
|
947
|
+
let At = wt.size, H = Z.size(), Re = ut.aggregate(), De = ct.aggregate(), Ee = ft.aggregate(), Pt = ot.size, d = Object.assign, Lt = r.length, Fe = se.length, Ot = re.aggregate(), Rt = Z.aggregate(), Dt = bt.aggregate(), Et = j.aggregate(), Ft = ve.aggregate(), Tt = Ye.c();
|
|
948
948
|
return {
|
|
949
949
|
stylesheet: {
|
|
950
|
-
sourceLinesOfCode:
|
|
951
|
-
linesOfCode:
|
|
950
|
+
sourceLinesOfCode: Tt.total + H + K + de.size(),
|
|
951
|
+
linesOfCode: Xt,
|
|
952
952
|
size: Lt,
|
|
953
|
-
complexity:
|
|
953
|
+
complexity: Ot.sum + Rt.sum + Dt.sum + Et.sum + Ft.sum,
|
|
954
954
|
comments: {
|
|
955
955
|
total: k,
|
|
956
956
|
size: w
|
|
@@ -968,90 +968,92 @@ function Di(r, t = {}) {
|
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
970
|
},
|
|
971
|
-
atrules:
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
971
|
+
atrules: d(
|
|
972
|
+
Tt,
|
|
973
|
+
{
|
|
974
|
+
fontface: d({
|
|
975
|
+
total: Fe,
|
|
976
|
+
totalUnique: Fe,
|
|
977
|
+
unique: se,
|
|
978
|
+
uniquenessRatio: Fe === 0 ? 0 : 1
|
|
979
|
+
}, e ? {
|
|
980
|
+
uniqueWithLocations: Ge.c().uniqueWithLocations
|
|
981
|
+
} : {}),
|
|
982
|
+
import: Qe.c(),
|
|
983
|
+
media: d(
|
|
984
|
+
Ze.c(),
|
|
985
|
+
{
|
|
986
|
+
browserhacks: Je.c(),
|
|
987
|
+
features: Xe.c()
|
|
988
|
+
}
|
|
989
|
+
),
|
|
990
|
+
charset: $e.c(),
|
|
991
|
+
supports: d(
|
|
992
|
+
ne.c(),
|
|
993
|
+
{
|
|
994
|
+
browserhacks: et.c()
|
|
995
|
+
}
|
|
996
|
+
),
|
|
997
|
+
keyframes: d(
|
|
998
|
+
ae.c(),
|
|
999
|
+
{
|
|
1000
|
+
prefixed: d(
|
|
1001
|
+
oe.c(),
|
|
1002
|
+
{
|
|
1003
|
+
ratio: z(oe.size(), ae.size())
|
|
1004
|
+
}
|
|
1005
|
+
)
|
|
1006
|
+
}
|
|
1007
|
+
),
|
|
1008
|
+
container: d(
|
|
1009
|
+
tt.c(),
|
|
1010
|
+
{
|
|
1011
|
+
names: Q.c()
|
|
1012
|
+
}
|
|
1013
|
+
),
|
|
1014
|
+
layer: le.c(),
|
|
1015
|
+
property: it.c(),
|
|
1016
|
+
complexity: Ot,
|
|
1017
|
+
nesting: d(
|
|
1018
|
+
ue.aggregate(),
|
|
1019
|
+
{
|
|
1020
|
+
items: ue.toArray()
|
|
1021
|
+
},
|
|
1022
|
+
rt.c()
|
|
1023
|
+
)
|
|
1024
|
+
}
|
|
1025
|
+
),
|
|
1024
1026
|
rules: {
|
|
1025
|
-
total:
|
|
1027
|
+
total: ce,
|
|
1026
1028
|
empty: {
|
|
1027
|
-
total:
|
|
1028
|
-
ratio: z(
|
|
1029
|
+
total: fe,
|
|
1030
|
+
ratio: z(fe, ce)
|
|
1029
1031
|
},
|
|
1030
1032
|
sizes: d(
|
|
1031
|
-
|
|
1033
|
+
pe.aggregate(),
|
|
1032
1034
|
{
|
|
1033
|
-
items:
|
|
1035
|
+
items: pe.toArray()
|
|
1034
1036
|
},
|
|
1035
1037
|
st.c()
|
|
1036
1038
|
),
|
|
1037
1039
|
nesting: d(
|
|
1038
|
-
|
|
1040
|
+
ge.aggregate(),
|
|
1039
1041
|
{
|
|
1040
|
-
items:
|
|
1042
|
+
items: ge.toArray()
|
|
1041
1043
|
},
|
|
1042
1044
|
at.c()
|
|
1043
1045
|
),
|
|
1044
1046
|
selectors: d(
|
|
1045
|
-
|
|
1047
|
+
he.aggregate(),
|
|
1046
1048
|
{
|
|
1047
|
-
items:
|
|
1049
|
+
items: he.toArray()
|
|
1048
1050
|
},
|
|
1049
1051
|
lt.c()
|
|
1050
1052
|
),
|
|
1051
1053
|
declarations: d(
|
|
1052
|
-
|
|
1054
|
+
me.aggregate(),
|
|
1053
1055
|
{
|
|
1054
|
-
items:
|
|
1056
|
+
items: me.toArray()
|
|
1055
1057
|
},
|
|
1056
1058
|
nt.c()
|
|
1057
1059
|
)
|
|
@@ -1067,48 +1069,48 @@ function Di(r, t = {}) {
|
|
|
1067
1069
|
/** @type Specificity */
|
|
1068
1070
|
max: M === void 0 ? [0, 0, 0] : M,
|
|
1069
1071
|
/** @type Specificity */
|
|
1070
|
-
sum: [
|
|
1072
|
+
sum: [Re.sum, De.sum, Ee.sum],
|
|
1071
1073
|
/** @type Specificity */
|
|
1072
|
-
mean: [
|
|
1074
|
+
mean: [Re.mean, De.mean, Ee.mean],
|
|
1073
1075
|
/** @type Specificity */
|
|
1074
|
-
mode: [
|
|
1076
|
+
mode: [Re.mode, De.mode, Ee.mode],
|
|
1075
1077
|
/** @type Specificity */
|
|
1076
1078
|
items: mt
|
|
1077
1079
|
},
|
|
1078
1080
|
pt.c()
|
|
1079
1081
|
),
|
|
1080
1082
|
complexity: d(
|
|
1081
|
-
|
|
1083
|
+
Rt,
|
|
1082
1084
|
ht.c(),
|
|
1083
1085
|
{
|
|
1084
1086
|
items: Z.toArray()
|
|
1085
1087
|
}
|
|
1086
1088
|
),
|
|
1087
1089
|
nesting: d(
|
|
1088
|
-
|
|
1090
|
+
ke.aggregate(),
|
|
1089
1091
|
{
|
|
1090
|
-
items:
|
|
1092
|
+
items: ke.toArray()
|
|
1091
1093
|
},
|
|
1092
1094
|
yt.c()
|
|
1093
1095
|
),
|
|
1094
1096
|
id: d(
|
|
1095
|
-
|
|
1097
|
+
we.c(),
|
|
1096
1098
|
{
|
|
1097
|
-
ratio: z(
|
|
1099
|
+
ratio: z(we.size(), H)
|
|
1098
1100
|
}
|
|
1099
1101
|
),
|
|
1100
1102
|
pseudoClasses: gt.c(),
|
|
1101
1103
|
accessibility: d(
|
|
1102
|
-
|
|
1104
|
+
be.c(),
|
|
1103
1105
|
{
|
|
1104
|
-
ratio: z(
|
|
1106
|
+
ratio: z(be.size(), H)
|
|
1105
1107
|
}
|
|
1106
1108
|
),
|
|
1107
|
-
keyframes:
|
|
1109
|
+
keyframes: de.c(),
|
|
1108
1110
|
prefixed: d(
|
|
1109
|
-
|
|
1111
|
+
ye.c(),
|
|
1110
1112
|
{
|
|
1111
|
-
ratio: z(
|
|
1113
|
+
ratio: z(ye.size(), H)
|
|
1112
1114
|
}
|
|
1113
1115
|
),
|
|
1114
1116
|
combinators: dt.c()
|
|
@@ -1121,15 +1123,15 @@ function Di(r, t = {}) {
|
|
|
1121
1123
|
total: J,
|
|
1122
1124
|
ratio: z(J, K),
|
|
1123
1125
|
inKeyframes: {
|
|
1124
|
-
total:
|
|
1125
|
-
ratio: z(
|
|
1126
|
+
total: xe,
|
|
1127
|
+
ratio: z(xe, J)
|
|
1126
1128
|
}
|
|
1127
1129
|
},
|
|
1128
1130
|
complexity: Dt,
|
|
1129
1131
|
nesting: d(
|
|
1130
|
-
|
|
1132
|
+
ze.aggregate(),
|
|
1131
1133
|
{
|
|
1132
|
-
items:
|
|
1134
|
+
items: ze.toArray()
|
|
1133
1135
|
},
|
|
1134
1136
|
kt.c()
|
|
1135
1137
|
)
|
|
@@ -1138,9 +1140,9 @@ function Di(r, t = {}) {
|
|
|
1138
1140
|
N.c(),
|
|
1139
1141
|
{
|
|
1140
1142
|
prefixed: d(
|
|
1141
|
-
|
|
1143
|
+
_e.c(),
|
|
1142
1144
|
{
|
|
1143
|
-
ratio: z(
|
|
1145
|
+
ratio: z(_e.size(), N.size())
|
|
1144
1146
|
}
|
|
1145
1147
|
),
|
|
1146
1148
|
custom: d(
|
|
@@ -1148,17 +1150,17 @@ function Di(r, t = {}) {
|
|
|
1148
1150
|
{
|
|
1149
1151
|
ratio: z(X.size(), N.size()),
|
|
1150
1152
|
importants: d(
|
|
1151
|
-
|
|
1153
|
+
Ce.c(),
|
|
1152
1154
|
{
|
|
1153
|
-
ratio: z(
|
|
1155
|
+
ratio: z(Ce.size(), X.size())
|
|
1154
1156
|
}
|
|
1155
1157
|
)
|
|
1156
1158
|
}
|
|
1157
1159
|
),
|
|
1158
1160
|
browserhacks: d(
|
|
1159
|
-
|
|
1161
|
+
Se.c(),
|
|
1160
1162
|
{
|
|
1161
|
-
ratio: z(
|
|
1163
|
+
ratio: z(Se.size(), N.size())
|
|
1162
1164
|
}
|
|
1163
1165
|
),
|
|
1164
1166
|
complexity: Et
|
|
@@ -1172,9 +1174,9 @@ function Di(r, t = {}) {
|
|
|
1172
1174
|
}
|
|
1173
1175
|
),
|
|
1174
1176
|
gradients: _t.c(),
|
|
1175
|
-
fontFamilies:
|
|
1176
|
-
fontSizes:
|
|
1177
|
-
lineHeights:
|
|
1177
|
+
fontFamilies: Ae.c(),
|
|
1178
|
+
fontSizes: Pe.c(),
|
|
1179
|
+
lineHeights: Le.c(),
|
|
1178
1180
|
zindexes: Ct.c(),
|
|
1179
1181
|
textShadows: zt.c(),
|
|
1180
1182
|
boxShadows: St.c(),
|
|
@@ -1184,7 +1186,7 @@ function Di(r, t = {}) {
|
|
|
1184
1186
|
timingFunctions: $.c()
|
|
1185
1187
|
},
|
|
1186
1188
|
prefixes: xt.c(),
|
|
1187
|
-
browserhacks:
|
|
1189
|
+
browserhacks: qe.c(),
|
|
1188
1190
|
units: Oe.count(),
|
|
1189
1191
|
complexity: Ft,
|
|
1190
1192
|
keywords: B.c(),
|
|
@@ -1197,18 +1199,18 @@ function Di(r, t = {}) {
|
|
|
1197
1199
|
}
|
|
1198
1200
|
};
|
|
1199
1201
|
}
|
|
1200
|
-
function
|
|
1202
|
+
function Wt(r, t) {
|
|
1201
1203
|
return r[0] === t[0] ? r[1] === t[1] ? t[2] - r[2] : t[1] - r[1] : t[0] - r[0];
|
|
1202
1204
|
}
|
|
1203
1205
|
export {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
+
Ei as analyze,
|
|
1207
|
+
Wt as compareSpecificity,
|
|
1206
1208
|
F as hasVendorPrefix,
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1209
|
+
Qt as isAccessibilitySelector,
|
|
1210
|
+
oi as isMediaBrowserhack,
|
|
1211
|
+
_i as isPropertyHack,
|
|
1212
|
+
ui as isSelectorPrefixed,
|
|
1213
|
+
ai as isSupportsBrowserhack,
|
|
1214
|
+
Jt as isValuePrefixed,
|
|
1215
|
+
Zt as selectorComplexity
|
|
1214
1216
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,21 @@ export function analyze(css: string, options?: Options): {
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
atrules: {
|
|
47
|
+
atrules: ({
|
|
48
|
+
total: number;
|
|
49
|
+
totalUnique: number;
|
|
50
|
+
uniquenessRatio: number;
|
|
51
|
+
unique: Record<string, number>;
|
|
52
|
+
} & ({
|
|
53
|
+
uniqueWithLocations: Record<string, {
|
|
54
|
+
line: number;
|
|
55
|
+
column: number;
|
|
56
|
+
offset: number;
|
|
57
|
+
length: number;
|
|
58
|
+
}[]>;
|
|
59
|
+
} | {
|
|
60
|
+
uniqueWithLocations?: undefined;
|
|
61
|
+
})) & {
|
|
48
62
|
fontface: {
|
|
49
63
|
total: number;
|
|
50
64
|
totalUnique: number;
|
|
@@ -261,7 +275,6 @@ export function analyze(css: string, options?: Options): {
|
|
|
261
275
|
} | {
|
|
262
276
|
uniqueWithLocations?: undefined;
|
|
263
277
|
});
|
|
264
|
-
total: number;
|
|
265
278
|
complexity: {
|
|
266
279
|
min: number | undefined;
|
|
267
280
|
max: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectwallace/css-analyzer",
|
|
3
3
|
"description": "The best CSS analyzer out there. Check design tokens, complexity, specificity, performance and more.",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.5.0",
|
|
5
5
|
"author": "Bart Veneman",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|