diff --git a/src/server/singbox.js b/src/server/singbox.js index 6adafde..5d1d3bf 100644 --- a/src/server/singbox.js +++ b/src/server/singbox.js @@ -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; } diff --git a/src/web/api.js b/src/web/api.js index a439112..a22de24 100644 --- a/src/web/api.js +++ b/src/web/api.js @@ -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: {