Skip to content

Commit fab00d2

Browse files
ahnopologeticskarim
authored andcommitted
refactor: stricter match to customFunction
1 parent 499d82b commit fab00d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/analyze/typescript/detectors/analytics-source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function isCustomFunction(node, customFunction) {
5050
ts.isElementAccessExpression(node.expression) || // For array/object access like trackers['analytics'].track()
5151
(ts.isPropertyAccessExpression(node.expression?.expression) && ts.isThisExpression(node.expression.expression.expression)); // For class methods like this.analytics.track()
5252

53-
return canBeCustomFunction && node.expression.getText().includes(customFunction);
53+
return canBeCustomFunction && node.expression.getText() === customFunction;
5454
}
5555

5656
/**

0 commit comments

Comments
 (0)