Skip to content

Commit

Permalink
strip-test-selectors: Replace isNotTestSelector() with isTestSelector()
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Apr 7, 2017
1 parent 91a7222 commit 260d156
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions strip-test-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

let TEST_SELECTOR_PREFIX = /data-test-.*/;

function isNotTestSelector(attribute) {
return !TEST_SELECTOR_PREFIX.test(attribute);
function isTestSelector(attribute) {
return TEST_SELECTOR_PREFIX.test(attribute);
}

function StripTestSelectorsTransform() {
Expand All @@ -18,15 +18,15 @@ StripTestSelectorsTransform.prototype.transform = function(ast) {
walker.visit(ast, function(node) {
if (node.type === 'ElementNode') {
node.attributes = node.attributes.filter(function(attribute) {
return isNotTestSelector(attribute.name);
return !isTestSelector(attribute.name);
});
} else if (node.type === 'MustacheStatement' || node.type === 'BlockStatement') {
node.params = node.params.filter(function(param) {
return isNotTestSelector(param.original);
return !isTestSelector(param.original);
});

node.hash.pairs = node.hash.pairs.filter(function(pair) {
return isNotTestSelector(pair.key);
return !isTestSelector(pair.key);
});
}
});
Expand Down

0 comments on commit 260d156

Please sign in to comment.