From b0a544b87987d34004776cfea95388d0f06adf85 Mon Sep 17 00:00:00 2001 From: xream Date: Fri, 28 Mar 2025 12:24:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=AD=A3=E5=88=99=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A1=BA=E5=BA=8F/=E5=80=92=E5=BA=8F/?= =?UTF-8?q?=E5=8E=9F=E9=A1=BA=E5=BA=8F(=E5=89=8D=E7=AB=AF=20>=202.15.10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/processors/index.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/package.json b/backend/package.json index af7d797..a0a95ea 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.10", + "version": "2.19.11", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index 5c26da0..b2cd9f2 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -284,7 +284,7 @@ function SortOperator(order = 'asc') { } // sort by regex -function RegexSortOperator(expressions) { +function RegexSortOperator(expressions, order = 'asc') { return { name: 'Regex Sort Operator', func: (proxies) => { @@ -295,8 +295,13 @@ function RegexSortOperator(expressions) { if (oA && !oB) return -1; if (oB && !oA) return 1; if (oA && oB) return oA < oB ? -1 : 1; - if ((!oA && !oB) || (oA && oB && oA === oB)) - return a.name < b.name ? -1 : 1; // fallback to normal sort + if (order === 'original') { + return 0; + } else if (order === 'desc') { + return a.name < b.name ? 1 : -1; + } else { + return a.name < b.name ? -1 : 1; + } }); }, };