Skip to content

Commit 4f54101

Browse files
committed
fix: remove perfStart and perfStop
1 parent a16d4b4 commit 4f54101

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

transformer.js

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ module.exports = function (program, cfg, { ts }) {
33
return (ctx) => {
44
return function visit(node) {
55
if (process.env.CI || !cfg.removePerf) return node;
6+
// Remove the functions
7+
if (ts.isFunctionDeclaration(node)
8+
&& [ 'perfStart', 'perfStop' ].includes(node.name.escapedText))
9+
return undefined
10+
11+
// Remove the invokes
612
if (
713
ts.isExpressionStatement(node) && ts.isCallExpression(node.expression) &&
814
[ 'perfStart', 'perfStop' ].includes(node.expression.expression.text)

0 commit comments

Comments
 (0)