first commit

This commit is contained in:
2025-03-07 22:27:18 +08:00
commit 912da26042
4457 changed files with 306818 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/**
* Get the source index of a selector, excluding leading whitespace.
*
* @param {import('postcss-selector-parser').Selector} node
*
* @returns {number}
*/
export default function getSelectorSourceIndex(node) {
// The first child node sourceIndex is the same as the parent sourceIndex without leading whitespace
// If the node doesn't have any children, use the node sourceIndex instead
return node.first?.sourceIndex ?? node.sourceIndex;
}