MCPcopy
hub / github.com/rollup/rollup / enforceTheAnswer

Function enforceTheAnswer

test/function/samples/plugin-parse/_config.js:19–29  ·  view source on GitHub ↗
(ast, magicString)

Source from the content-addressed store, hash-verified

17});
18
19function enforceTheAnswer(ast, magicString) {
20 for (const node of ast.body) {
21 if (node.type === 'VariableDeclaration') {
22 for (const decl of node.declarations) {
23 if (decl.id.name === 'answer') {
24 magicString.overwrite(decl.init.start, decl.init.end, '42');
25 }
26 }
27 }
28 }
29}

Callers 1

transformFunction · 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…