Introduce ESLint and Prettier

This commit is contained in:
Zaid Abdulla committed 2018-08-24 05:31:22 -07:00
1 parent 9c943d0bbf
commit e494bdca8a
26 files changed
+1585 -1594

No files matched your search

+10 -11
View File
@@ -1,5 +1,5 @@
/**
* Copyright 2013-2017 Zaid Abdulla
* Copyright 2013-2018 Zaid Abdulla
*
* This file is part of GenieACS.
*
@@ -41,32 +41,31 @@ function estimateGpnCount(gpnPatterns, depth = 0) {
let k = path[depth];
if (!k) {
if (flags & 1)
gpnCount = 1;
if (flags & 1) gpnCount = 1;
continue;
}
if (flags & 1) {
gpnCount = 1;
if (depth > UNDISCOVERED_DEPTH)
continue;
}
else if (k === "*")
if (depth > UNDISCOVERED_DEPTH) continue;
} else if (k === "*") {
wildcardDiscovered = true;
}
if (k === "*") {
wildcardChildren.push(pattern);
}
else {
} else {
children[k] = children[k] || [];
children[k].push(pattern);
}
}
let wildcardGpnCount = 0;
if (!wildcardDiscovered && wildcardChildren.length)
wildcardGpnCount += estimateGpnCount(wildcardChildren, depth + 1) * WILDCARD_MULTIPLIER;
if (!wildcardDiscovered && wildcardChildren.length) {
wildcardGpnCount +=
estimateGpnCount(wildcardChildren, depth + 1) * WILDCARD_MULTIPLIER;
}
for (let k of Object.keys(children)) {
let c = estimateGpnCount(children[k].concat(wildcardChildren), depth + 1);