support yaml anchor

This commit is contained in:
pompurin404 2024-08-10 18:16:33 +08:00
parent f7f8dc188a
commit 85a324b428
No known key found for this signature in database
2 changed files with 2 additions and 1 deletions

View File

@ -111,7 +111,7 @@ function getRuntimeConfigStr(): string {
return fs.readFileSync(mihomoWorkConfigPath(), 'utf8')
}
function getRuntimeConfig(): Record<string, unknown> {
function getRuntimeConfig(): IMihomoConfig {
return yaml.parse(getRuntimeConfigStr())
}

View File

@ -30,6 +30,7 @@ const Proxies: React.FC = () => {
const groups: IMihomoGroup[] = []
if (proxies && proxies.proxies) {
runtime?.['proxy-groups']?.forEach((group: { name: string; url?: string }) => {
group = Object.assign(group, group['<<'])
const { name, url } = group
if (
proxies.proxies[name] &&