MCPcopy
hub / github.com/less/less.js / install

Function install

packages/test-data/plugin/plugin-preeval.js:2–25  ·  view source on GitHub ↗
({ tree: { Quoted }, visitors }, manager)

Source from the content-addressed store, hash-verified

1module.exports = {
2 install({ tree: { Quoted }, visitors }, manager) {
3 class Visitor {
4 constructor() {
5 this.native = new visitors.Visitor(this);
6
7 this.isPreEvalVisitor = true;
8 this.isReplacing = true;
9 }
10
11 run(root) {
12 return this.native.visit(root);
13 }
14
15 visitVariable(node) {
16 if (node.name === '@replace') {
17 return new Quoted(`'`, 'bar', true);
18 }
19 return node;
20 }
21 }
22
23 manager.addVisitor(new Visitor());
24 // console.log(manager);
25 },
26 minVersion: [2,0,0]
27};

Callers

nothing calls this directly

Calls 1

addVisitorMethod · 0.80

Tested by

no test coverage detected