mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 19:59:01 +08:00
perf: Allow using full configuration as subscription source
Supported configuration formats: Loon, QX, and Surge closes #121
This commit is contained in:
parent
f93398b701
commit
4095606bdf
4
backend/dist/cron-sync-artifacts.min.js
vendored
4
backend/dist/cron-sync-artifacts.min.js
vendored
File diff suppressed because one or more lines are too long
4
backend/dist/sub-store-parser.loon.min.js
vendored
4
backend/dist/sub-store-parser.loon.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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()];
|
||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user