surgio
Version:
Generating rules for Surge, Clash, Quantumult like a PRO
18 lines • 604 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = relayableUrl;
function relayableUrl(url, relayUrl) {
if (typeof relayUrl === 'string') {
if (relayUrl.includes('%%URL%%')) {
return relayUrl.replace('%%URL%%', encodeURIComponent(url));
}
else if (relayUrl.includes('%URL%')) {
return relayUrl.replace('%URL%', url);
}
else {
throw new Error('relayUrl 中必须包含 %URL% 或 %%URL%% 替换指示符');
}
}
return url;
}
//# sourceMappingURL=relayable-url.js.map