From a591926e4f62657d4b157e26ceee70564120134b Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Thu, 6 May 2021 16:21:02 +0200 Subject: [PATCH] Inline `stripTestSelectors()` function It's no longer worth it for just two lines of code... --- strip-test-selectors.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/strip-test-selectors.js b/strip-test-selectors.js index a6262a9f..15a93878 100644 --- a/strip-test-selectors.js +++ b/strip-test-selectors.js @@ -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', @@ -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)); }, } };