style: отформатирован код для улучшения читаемости
All checks were successful
Build and Deploy Gateway / build-and-deploy (push) Successful in 18s

This commit is contained in:
2026-05-08 19:49:54 +03:00
parent 27b71077b1
commit b1c8eea976
2 changed files with 11 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -29,7 +29,10 @@ export const api = {
ruleSets: {
get: () => request("/api/rule-sets"),
save: (ruleSets) =>
request("/api/rule-sets", { method: "PUT", body: JSON.stringify({ ruleSets }) }),
request("/api/rule-sets", {
method: "PUT",
body: JSON.stringify({ ruleSets }),
}),
},
subscription: {