mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-28 15:33:47 +00:00
perf: Allow using full configuration as subscription source
Supported configuration formats: Loon, QX, and Surge closes #121
This commit is contained in:
1 parent
f93398b701
commit
4095606bdf
4 files changed
+22
-7
No files matched your search
@@ -89,4 +89,19 @@ function SSD() {
|
||||
return { name, test, parse };
|
||||
}
|
||||
|
||||
export default [HTML(), Base64Encoded(), Clash(), SSD()];
|
||||
function FullConfig() {
|
||||
const name = 'Full Config Preprocessor';
|
||||
const test = function (raw) {
|
||||
return /^(\[server_local\]|\[Proxy\])/gm.test(raw);
|
||||
};
|
||||
const parse = function (raw) {
|
||||
const regex = /^(\[server_local\]|\[Proxy\])\n?((.|\n)*?)\[/gm;
|
||||
const result = regex.exec(raw);
|
||||
if (result) {
|
||||
return result[2] || '';
|
||||
}
|
||||
};
|
||||
return { name, test, parse };
|
||||
}
|
||||
|
||||
export default [HTML(), Base64Encoded(), Clash(), SSD(), FullConfig()];
|
||||
Reference in new issue
Block a user