Skip to content

Commit

Permalink
perf(utils): only check selector on 'rule' nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Jul 7, 2023
1 parent 1275026 commit d9c6183
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export function performFeatureCheck(check, candidate) {
* @return {(rule:import('postcss').ChildNode) => boolean}
*/
export function checkSelector(selector) {
// @ts-ignore rule.selector can be `undefined`
return (rule) => performFeatureCheck(selector, rule.selector);
return (rule) => rule.type === 'rule'
&& performFeatureCheck(selector, rule.selector);
}

/**
Expand Down

0 comments on commit d9c6183

Please sign in to comment.