MCPcopy
hub / github.com/postcss/postcss / hasAlready

Function hasAlready

test/visitor.test.ts:18–25  ·  view source on GitHub ↗
(parent: Container | undefined, selector: string)

Source from the content-addressed store, hash-verified

16} from '../lib/postcss.js'
17
18function hasAlready(parent: Container | undefined, selector: string): boolean {
19 if (typeof parent === 'undefined') return false
20 return (
21 parent.nodes?.some(i => {
22 return i.type === 'rule' && i.selectors.includes(selector)
23 }) ?? false
24 )
25}
26
27function addIndex(array: any[][]): any[][] {
28 return array.map((i, index) => {

Callers 1

RuleFunction · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…