style: отформатирован код для улучшения читаемости
All checks were successful
Build and Deploy Gateway / build-and-deploy (push) Successful in 18s
All checks were successful
Build and Deploy Gateway / build-and-deploy (push) Successful in 18s
This commit is contained in:
@@ -36,7 +36,9 @@ function findOutbound(subscriptionConfig, selectedTag) {
|
||||
function readCustomRuleSets() {
|
||||
try {
|
||||
if (!fs.existsSync(settings.customRuleSetsPath)) return [];
|
||||
const data = JSON.parse(fs.readFileSync(settings.customRuleSetsPath, "utf8"));
|
||||
const data = JSON.parse(
|
||||
fs.readFileSync(settings.customRuleSetsPath, "utf8"),
|
||||
);
|
||||
return Array.isArray(data) ? data : [];
|
||||
} catch {
|
||||
return [];
|
||||
@@ -75,7 +77,10 @@ function ruleSets(customRuleSets = []) {
|
||||
|
||||
// Пользовательские rule-sets не должны дублировать встроенные
|
||||
const builtInTags = new Set(builtIn.map((rs) => rs.tag));
|
||||
const merged = [...builtIn, ...custom.filter((rs) => !builtInTags.has(rs.tag))];
|
||||
const merged = [
|
||||
...builtIn,
|
||||
...custom.filter((rs) => !builtInTags.has(rs.tag)),
|
||||
];
|
||||
return merged;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user