Skip to content

Commit

Permalink
Inline stripTestSelectors() function
Browse files Browse the repository at this point in the history
It's no longer worth it for just two lines of code...
  • Loading branch information
Turbo87 committed May 6, 2021
1 parent 8c63b8a commit a591926
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions strip-test-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ function isTestSelector(attribute) {
return TEST_SELECTOR_PREFIX.test(attribute);
}

function stripTestSelectors(node) {
node.params = node.params.filter(param => !isTestSelector(param.original));
node.hash.pairs = node.hash.pairs.filter(pair => !isTestSelector(pair.key));
}

function transform() {
return {
name: 'strip-test-selectors',
Expand All @@ -23,11 +18,13 @@ function transform() {
},

MustacheStatement(node) {
stripTestSelectors(node);
node.params = node.params.filter(param => !isTestSelector(param.original));
node.hash.pairs = node.hash.pairs.filter(pair => !isTestSelector(pair.key));
},

BlockStatement(node) {
stripTestSelectors(node);
node.params = node.params.filter(param => !isTestSelector(param.original));
node.hash.pairs = node.hash.pairs.filter(pair => !isTestSelector(pair.key));
},
}
};
Expand Down

0 comments on commit a591926

Please sign in to comment.