Skip to content

Commit 504331d

Browse files
authored
Merge pull request #86 from Turbo87/telemetry-lookup
Fix substring component matches
2 parents ed5bcc7 + d689459 commit 504331d

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

transforms/no-implicit-this/__testfixtures__/-mock-telemetry.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"foo": { "type": "Component" },
77
"namespace/foo": { "type": "Component" },
88
"my-helper": { "type": "Helper" },
9-
"a-helper": { "type": "Helper" }
9+
"a-helper": { "type": "Helper" },
10+
"foo-bar-baz": { "type": "Component" }
1011
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{{foo-bar-baz}}
2+
{{baz}}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{{foo-bar-baz}}
2+
{{this.baz}}

transforms/no-implicit-this/helpers/plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function transform(root, options = {}) {
8989
return true;
9090
}
9191

92-
let helper = helpers.find(path => path.endsWith(name));
92+
let helper = helpers.find(path => path.endsWith(`/${name}`));
9393
if (helper) {
9494
let message = `Skipping \`%s\` because it appears to be a helper from the telemetry data: %s`;
9595
debug(message, name, helper);
@@ -100,7 +100,7 @@ function transform(root, options = {}) {
100100
}
101101

102102
function isComponent(name) {
103-
let component = components.find(path => path.endsWith(name));
103+
let component = components.find(path => path.endsWith(`/${name}`));
104104
if (component) {
105105
let message = `Skipping \`%s\` because it appears to be a component from the telemetry data: %s`;
106106
debug(message, name, component);

0 commit comments

Comments
 (0)