@projectwallace/css-analyzer 9.6.2 → 9.6.3

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as isSupportsBrowserhack, t as isMediaBrowserhack } from "./atrules-Bnb0wvNR.js";
2
2
  import { t as KeywordSet } from "./keyword-set-qSyAMR9o.js";
3
3
  import { n as unquote, t as endsWith } from "./string-utils-C97yyuqE.js";
4
- import { a as getComplexity, i as getCombinators, n as calculateForAST, o as isAccessibility, s as isPrefixed, t as calculate } from "./specificity-DKo9lvB5.js";
4
+ import { a as getComplexity, i as getCombinators, n as calculateForAST, o as isAccessibility, s as isPrefixed, t as calculate } from "./specificity-De-8dx4H.js";
5
5
  import { a as keywords, c as namedColors, i as isValueReset, l as systemColors, n as SYSTEM_FONTS, o as colorFunctions, r as destructure, s as colorKeywords, t as isIe9Hack } from "./browserhacks-BtVwVqdU.js";
6
6
  import { a as shorthand_properties, i as isHack, n as basename, r as border_radius_properties, t as SPACING_RESET_PROPERTIES } from "./property-utils-B3n9KkA9.js";
7
7
  import { SKIP, is_atrule, is_atrule_prelude, is_attribute_selector, is_container_query, is_custom, is_declaration, is_dimension, is_function, is_hash, is_identifier, is_layer_name, is_media_feature, is_operator, is_pseudo_class_selector, is_pseudo_element_selector, is_raw, is_rule, is_selector, is_selector_list, is_supports_query, is_type_selector, is_url, is_vendor_prefixed, parse, str_starts_with, walk } from "@projectwallace/css-parser";
@@ -1,2 +1,2 @@
1
- import { a as getComplexity, i as getCombinators, n as calculateForAST, o as isAccessibility, r as compare, s as isPrefixed, t as calculate } from "../specificity-DKo9lvB5.js";
1
+ import { a as getComplexity, i as getCombinators, n as calculateForAST, o as isAccessibility, r as compare, s as isPrefixed, t as calculate } from "../specificity-De-8dx4H.js";
2
2
  export { compare as compareSpecificity, getCombinators, getComplexity, calculate as getSpecificity, calculateForAST as getSpecificityForAST, isAccessibility, isPrefixed };
@@ -143,7 +143,7 @@ const calculateForAST = (selectorAST) => {
143
143
  case "has":
144
144
  if (current.has_children) {
145
145
  const childSelectorList = current.first_child;
146
- if (is_selector_list(childSelectorList)) {
146
+ if (childSelectorList && is_selector_list(childSelectorList)) {
147
147
  const max1 = max(calculate(childSelectorList));
148
148
  a += max1[0];
149
149
  b += max1[1];
@@ -155,7 +155,7 @@ const calculateForAST = (selectorAST) => {
155
155
  case "nth-last-child":
156
156
  b += 1;
157
157
  const nthOf = current.first_child;
158
- if (is_nth_of_selector(nthOf) && nthOf.selector) {
158
+ if (nthOf && is_nth_of_selector(nthOf) && nthOf.selector) {
159
159
  const max2 = max(calculate(nthOf.selector));
160
160
  a += max2[0];
161
161
  b += max2[1];
@@ -165,7 +165,7 @@ const calculateForAST = (selectorAST) => {
165
165
  case "host-context":
166
166
  case "host":
167
167
  b += 1;
168
- const childSelector = current.first_child.first_child;
168
+ const childSelector = current.first_child?.first_child;
169
169
  if (childSelector && is_selector(childSelector)) {
170
170
  let childPart = childSelector.first_child;
171
171
  while (childPart) {
@@ -197,8 +197,8 @@ const calculateForAST = (selectorAST) => {
197
197
  switch (current.name.toLowerCase()) {
198
198
  case "slotted":
199
199
  c += 1;
200
- const childSelector = current.first_child.first_child;
201
- if (is_selector(childSelector)) {
200
+ const childSelector = current.first_child?.first_child;
201
+ if (childSelector && is_selector(childSelector)) {
202
202
  let childPart = childSelector.first_child;
203
203
  while (childPart) {
204
204
  if (is_combinator(childPart)) break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectwallace/css-analyzer",
3
- "version": "9.6.2",
3
+ "version": "9.6.3",
4
4
  "description": "The best CSS analyzer out there. Check design tokens, complexity, specificity, performance and more.",
5
5
  "keywords": [
6
6
  "analytics",