first commit
This commit is contained in:
18
node_modules/stylelint/lib/utils/getSelectorSourceIndex.cjs
generated
vendored
Normal file
18
node_modules/stylelint/lib/utils/getSelectorSourceIndex.cjs
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// NOTICE: This file is generated by Rollup. To modify it,
|
||||
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Get the source index of a selector, excluding leading whitespace.
|
||||
*
|
||||
* @param {import('postcss-selector-parser').Selector} node
|
||||
*
|
||||
* @returns {number}
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
module.exports = getSelectorSourceIndex;
|
||||
Reference in New Issue
Block a user