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) {
if (params.mode === "script") {
params.mode = "rule";
function main(config) {
if (config.mode === "script") {
config.mode = "rule";
}
return params;
return config;
}

View File

@ -1,10 +1,10 @@
function main(params) {
if (Array.isArray(params.proxies)) {
params.proxies.forEach((p, i) => {
function main(config) {
if (Array.isArray(config.proxies)) {
config.proxies.forEach((p, i) => {
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
/// 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
pub const ITEM_MERGE: &str = "# Merge Template for clash verge
# The `Merge` format used to enhance profile
pub const ITEM_MERGE: &str = "# Profile Enhancement Merge Template for Clash Verge
prepend-rules: []
@ -36,9 +35,9 @@ append-proxy-groups: []
";
/// enhanced profile
pub const ITEM_SCRIPT: &str = "// Define the `main` function
pub const ITEM_SCRIPT: &str = "// Define main function (script entry)
function main(params) {
return params;
function main(config) {
return config;
}
";