Skip to content

Commit 15a1365

Browse files
committed
Unambiguous helpers: simplify logic
1 parent 882c956 commit 15a1365

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

transforms/angle-brackets/transform.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,12 @@ function isBuiltInComponent(key) {
4545
return BUILT_IN_COMPONENTS.includes(key);
4646
}
4747

48-
function isNestedComponentTagName(tagName, unambiguousHelpers = false) {
49-
if (unambiguousHelpers) {
50-
return (
51-
tagName &&
52-
tagName.includes &&
53-
(tagName.includes('/') || (tagName.includes('-') && tagName.includes('.')))
54-
);
55-
}
56-
57-
return tagName && tagName.includes && (tagName.includes('/') || tagName.includes('-'));
48+
function isNestedComponentTagName(tagName) {
49+
return (
50+
tagName &&
51+
tagName.includes &&
52+
(tagName.includes('/') || (tagName.includes('-') && tagName.includes('.')))
53+
);
5854
}
5955

6056
function isWallStreet(tagName) {
@@ -491,7 +487,7 @@ function transformToAngleBracket(fileInfo, config, invokableData) {
491487
? node.loc.source !== '(synthetic)' && !isTagKnownHelper
492488
: node.loc.source !== '(synthetic)' && !isKnownHelper(tagName, config, invokableData);
493489

494-
const isNestedComponent = isNestedComponentTagName(tagName, config.unambiguousHelpers);
490+
const isNestedComponent = isNestedComponentTagName(tagName);
495491

496492
if (
497493
isValidMustacheComponent &&

transforms/angle-brackets/transform.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ test('tilde', () => {
878878
expect(runTest('tilde.hbs', input)).toMatchInlineSnapshot(`
879879
"
880880
{{#if foo~}}
881-
<SomeComponent />
881+
{{some-component}}
882882
{{/if}}
883883
"
884884
`);

0 commit comments

Comments
 (0)