chore: minor css-prune.js tweaks (#14457)

pull/14460/head
Rich Harris 4 weeks ago committed by GitHub
parent 19d80ad63c
commit e9ff665bea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -141,16 +141,12 @@ function get_relative_selectors(node) {
// nesting could be inside pseudo classes like :is, :has or :where // nesting could be inside pseudo classes like :is, :has or :where
for (let selector of selectors) { for (let selector of selectors) {
walk( walk(selector, null, {
selector, // @ts-ignore
{}, NestingSelector() {
{ has_explicit_nesting_selector = true;
// @ts-ignore
NestingSelector() {
has_explicit_nesting_selector = true;
}
} }
); });
// if we found one we can break from the others // if we found one we can break from the others
if (has_explicit_nesting_selector) break; if (has_explicit_nesting_selector) break;
} }
@ -881,17 +877,17 @@ function get_element_parent(node) {
} }
/** /**
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} element * @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} node
* @param {boolean} adjacent_only * @param {boolean} adjacent_only
* @returns {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement | Compiler.AST.SlotElement | Compiler.AST.RenderTag, NodeExistsValue>} * @returns {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement | Compiler.AST.SlotElement | Compiler.AST.RenderTag, NodeExistsValue>}
*/ */
function get_possible_element_siblings(element, adjacent_only) { function get_possible_element_siblings(node, adjacent_only) {
/** @type {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement | Compiler.AST.SlotElement | Compiler.AST.RenderTag, NodeExistsValue>} */ /** @type {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement | Compiler.AST.SlotElement | Compiler.AST.RenderTag, NodeExistsValue>} */
const result = new Map(); const result = new Map();
const path = element.metadata.path; const path = node.metadata.path;
/** @type {Compiler.SvelteNode} */ /** @type {Compiler.SvelteNode} */
let current = element; let current = node;
let i = path.length; let i = path.length;

Loading…
Cancel
Save