MCPcopy Create free account
hub / github.com/babel/babel / LogicalExpression

Function LogicalExpression

scripts/babel-plugin-toggle-boolean-flag/plugin.ts:127–137  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

125 }
126 },
127 LogicalExpression(path) {
128 if (value === null) return;
129
130 const res = evaluate(path.node, value);
131 if (res.unrelated) return;
132 if (res.replacement) {
133 path.replaceWith(res.replacement);
134 } else {
135 path.replaceWith(t.booleanLiteral(res.value));
136 }
137 },
138 MemberExpression(path) {
139 if (value === null) return;
140

Callers

nothing calls this directly

Calls 1

evaluateFunction · 0.70

Tested by

no test coverage detected