mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-07 12:33:20 +08:00
feat: 支持使用代理/节点/策略获取订阅
This commit is contained in:
@@ -35,6 +35,17 @@ function getIfPresent(obj, defaultValue) {
|
||||
return isPresent(obj) ? obj : defaultValue;
|
||||
}
|
||||
|
||||
function getPolicyDescriptor(str) {
|
||||
if (!str) return {};
|
||||
return /^.+?\s*?=\s*?.+?\s*?,.+?/.test(str)
|
||||
? {
|
||||
'policy-descriptor': str,
|
||||
}
|
||||
: {
|
||||
policy: str,
|
||||
};
|
||||
}
|
||||
|
||||
const utf8ArrayToStr =
|
||||
typeof TextDecoder !== 'undefined'
|
||||
? (v) => new TextDecoder().decode(new Uint8Array(v))
|
||||
@@ -91,4 +102,5 @@ export {
|
||||
isPresent,
|
||||
getIfPresent,
|
||||
utf8ArrayToStr,
|
||||
getPolicyDescriptor,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user