aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-03 12:00:13 -0400
committerGitHub <noreply@github.com>2020-07-03 12:00:13 -0400
commit6ede83f2934195cb1dc5f261834b7c1bca8bfa90 (patch)
tree50798b082475b2a82c999f65391e46ad239d45d1 /ext/bg/js
parent562cfd74708c47c93f22d809c9d3064ab099bfce (diff)
Move private function definitions inside of IIFE (#641)
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/profile-conditions.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/ext/bg/js/profile-conditions.js b/ext/bg/js/profile-conditions.js
index 97e09f1c..f3a85cb1 100644
--- a/ext/bg/js/profile-conditions.js
+++ b/ext/bg/js/profile-conditions.js
@@ -19,29 +19,29 @@
* Environment
*/
-function _profileConditionTestDomain(urlDomain, domain) {
- return (
- urlDomain.endsWith(domain) &&
- (
- domain.length === urlDomain.length ||
- urlDomain[urlDomain.length - domain.length - 1] === '.'
- )
- );
-}
+let profileConditionsDescriptor = null;
-function _profileConditionTestDomainList(url, domainList) {
- const urlDomain = new URL(url).hostname.toLowerCase();
- for (const domain of domainList) {
- if (_profileConditionTestDomain(urlDomain, domain)) {
- return true;
- }
+const profileConditionsDescriptorPromise = (async () => {
+ function profileConditionTestDomain(urlDomain, domain) {
+ return (
+ urlDomain.endsWith(domain) &&
+ (
+ domain.length === urlDomain.length ||
+ urlDomain[urlDomain.length - domain.length - 1] === '.'
+ )
+ );
}
- return false;
-}
-let profileConditionsDescriptor = null;
+ function profileConditionTestDomainList(url, domainList) {
+ const urlDomain = new URL(url).hostname.toLowerCase();
+ for (const domain of domainList) {
+ if (profileConditionTestDomain(urlDomain, domain)) {
+ return true;
+ }
+ }
+ return false;
+ }
-const profileConditionsDescriptorPromise = (async () => {
const environment = new Environment();
await environment.prepare();
@@ -111,7 +111,7 @@ const profileConditionsDescriptorPromise = (async () => {
transform: (optionValue) => optionValue.split(/[,;\s]+/).map((v) => v.trim().toLowerCase()).filter((v) => v.length > 0),
transformReverse: (transformedOptionValue) => transformedOptionValue.join(', '),
validateTransformed: (transformedOptionValue) => (transformedOptionValue.length > 0),
- test: ({url}, transformedOptionValue) => _profileConditionTestDomainList(url, transformedOptionValue)
+ test: ({url}, transformedOptionValue) => profileConditionTestDomainList(url, transformedOptionValue)
},
matchRegExp: {
name: 'Matches RegExp',