chore: profile template typo

This commit is contained in:
dongchengjie 2024-05-04 14:24:11 +08:00
parent 7edd7f27cb
commit 05fa6b9aba
3 changed files with 17 additions and 18 deletions

View File

@ -1,6 +1,6 @@
function main(params) { function main(config) {
if (params.mode === "script") { if (config.mode === "script") {
params.mode = "rule"; config.mode = "rule";
} }
return params; return config;
} }

View File

@ -1,10 +1,10 @@
function main(params) { function main(config) {
if (Array.isArray(params.proxies)) { if (Array.isArray(config.proxies)) {
params.proxies.forEach((p, i) => { config.proxies.forEach((p, i) => {
if (p.type === "hysteria" && typeof p.alpn === "string") { if (p.type === "hysteria" && typeof p.alpn === "string") {
params.proxies[i].alpn = [p.alpn]; config.proxies[i].alpn = [p.alpn];
} }
}); });
} }
return params; return config;
} }

View File

@ -1,18 +1,17 @@
//! Some config file template //! Some config file template
/// template for new a profile item /// template for new a profile item
pub const ITEM_LOCAL: &str = "# Profile Template for clash verge pub const ITEM_LOCAL: &str = "# Profile Template for Clash Verge
proxies: proxies: []
proxy-groups: proxy-groups: []
rules: rules: []
"; ";
/// enhanced profile /// enhanced profile
pub const ITEM_MERGE: &str = "# Merge Template for clash verge pub const ITEM_MERGE: &str = "# Profile Enhancement Merge Template for Clash Verge
# The `Merge` format used to enhance profile
prepend-rules: [] prepend-rules: []
@ -36,9 +35,9 @@ append-proxy-groups: []
"; ";
/// enhanced profile /// enhanced profile
pub const ITEM_SCRIPT: &str = "// Define the `main` function pub const ITEM_SCRIPT: &str = "// Define main function (script entry)
function main(params) { function main(config) {
return params; return config;
} }
"; ";