@@ -9,6 +9,7 @@ import $ from '@/core/app';
99import { hex_md5 } from '@/vendor/md5' ;
1010import { ProxyUtils } from '@/core/proxy-utils' ;
1111import { produceArtifact } from '@/restful/sync' ;
12+ import { isMihomoConfigFile } from '@/utils/file-type' ;
1213import { SETTINGS_KEY } from '@/constants' ;
1314import YAML from '@/utils/yaml' ;
1415
@@ -397,7 +398,7 @@ function ScriptOperator(
397398 name : 'Script Operator' ,
398399 func : async ( proxies ) => {
399400 let output = proxies ;
400- if ( output ?. $file ?. type === 'mihomoProfile' ) {
401+ if ( isMihomoConfigFile ( output ?. $file ) ) {
401402 try {
402403 let patch = YAML . safeLoad ( script ) ;
403404 let config ;
@@ -438,7 +439,7 @@ function ScriptOperator(
438439 `async function operator(input = [], targetPlatform, context) {
439440 if (input && (input.$files || input.$content)) {
440441 let { $content, $files, $options, $file } = input
441- if($file.type === 'mihomoProfile') {
442+ if (['mihomoConfig', 'mihomoProfile'].includes($file?.type) ) {
442443 ${ script }
443444 if(typeof main === 'function') {
444445 let config;
@@ -496,7 +497,7 @@ function AddProxiesFromSubscriptionOperator({
496497 position = 'replace' ,
497498} = { } ) {
498499 const apply = async ( input ) => {
499- if ( input ?. $file ?. type !== 'mihomoProfile' ) return input ;
500+ if ( ! isMihomoConfigFile ( input ?. $file ) ) return input ;
500501
501502 const config = normalizeMihomoConfig ( input . $content ) ;
502503 const currentProxies = getMihomoProfileProxies ( config ) ;
0 commit comments