mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-27 06:43:08 +00:00
Merge pull request #664 from FaintGhost/fix/lowercase-clash-target
fix(producers): 补全 clash 目标的小写别名
This commit is contained in:
2 files changed
+36
No files matched your search
@@ -28,6 +28,7 @@ export default {
|
||||
SurgeMac: SurgeMac_Producer(),
|
||||
Loon: Loon_Producer(),
|
||||
Clash: Clash_Producer(),
|
||||
clash: Clash_Producer(),
|
||||
meta: ClashMeta_Producer(),
|
||||
clashmeta: ClashMeta_Producer(),
|
||||
'clash.meta': ClashMeta_Producer(),
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { expect } from 'chai';
|
||||
import { describe, it } from 'mocha';
|
||||
|
||||
import { ProxyUtils } from '@/core/proxy-utils';
|
||||
import { produceExternal } from './helpers';
|
||||
|
||||
const PROXY = {
|
||||
type: 'ss',
|
||||
name: 'SS Node',
|
||||
server: '1.2.3.4',
|
||||
port: 443,
|
||||
cipher: 'aes-128-gcm',
|
||||
password: 'secret',
|
||||
};
|
||||
|
||||
describe('Proxy target aliases', function () {
|
||||
it('produces the same output for lowercase and capitalized target names', function () {
|
||||
const cases = [
|
||||
['clash', 'Clash'],
|
||||
['meta', 'ClashMeta'],
|
||||
['mihomo', 'ClashMeta'],
|
||||
['uri', 'URI'],
|
||||
['v2ray', 'V2Ray'],
|
||||
['json', 'JSON'],
|
||||
['stash', 'Stash'],
|
||||
['egern', 'Egern'],
|
||||
['sing-box', 'sing-box'],
|
||||
];
|
||||
for (const [lower, canonical] of cases) {
|
||||
expect(produceExternal(lower, [PROXY]), lower).to.equal(
|
||||
produceExternal(canonical, [PROXY]),
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user