MCPcopy
hub / github.com/postcss/postcss / buildVisitor

Function buildVisitor

test/visitor.test.ts:33–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33function buildVisitor(): [[string, string][], Plugin] {
34 let visits: [string, string][] = []
35 let visitor: Plugin = {
36 AtRule(i) {
37 visits.push(['AtRule', i.name])
38 },
39 AtRuleExit(i) {
40 visits.push(['AtRuleExit', i.name])
41 },
42 Comment(i) {
43 visits.push(['Comment', i.text])
44 },
45 CommentExit(i) {
46 visits.push(['CommentExit', i.text])
47 },
48 Declaration(i) {
49 visits.push(['Declaration', i.prop + ': ' + i.value])
50 },
51 DeclarationExit(i) {
52 visits.push(['DeclarationExit', i.prop + ': ' + i.value])
53 },
54 Document(i) {
55 visits.push(['Document', `${i.nodes.length}`])
56 },
57 DocumentExit(i) {
58 visits.push(['DocumentExit', `${i.nodes.length}`])
59 },
60 Once(i) {
61 visits.push(['Once', `${i.nodes.length}`])
62 },
63 OnceExit(i) {
64 visits.push(['OnceExit', `${i.nodes.length}`])
65 },
66 postcssPlugin: 'visitor',
67 Root(i) {
68 visits.push(['Root', `${i.nodes.length}`])
69 },
70 RootExit(i) {
71 visits.push(['RootExit', `${i.nodes.length}`])
72 },
73 Rule(i) {
74 visits.push(['Rule', i.selector])
75 },
76 RuleExit(i) {
77 visits.push(['RuleExit', i.selector])
78 }
79 }
80 return [visits, visitor]
81}
82
83let replaceColorGreenClassic: Plugin = {
84 Once(root) {

Callers 1

visitor.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…