Skip to content

Commit

Permalink
feat: 内置协议过滤器更名
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 原有命名已不做支持
  • Loading branch information
geekdada committed Jul 12, 2020
1 parent 87e00ea commit 6aa6531
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
6 changes: 6 additions & 0 deletions docs/guide/upgrade-guide-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

由于 Surge 新版已经发布了一段时间,故不再默认使用 `custom` 的方式输出 Shadowsocks 节点。

## 内置过滤器

#### 协议过滤器名称修改

由于疏忽,有一些 [协议过滤器](/guide/custom-template.md#协议过滤器) 命名未符合规范,已修改。

## 自定义过滤器

#### useProviders, discardProviders 默认开启严格模式
Expand Down
28 changes: 14 additions & 14 deletions lib/generator/artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ import {
youtubePremiumFilter as defaultYoutubePremiumFilter,
shadowsocksFilter,
shadowsocksrFilter,
VmessFilter,
V2rayFilter,
SnellFilter,
HttpFilter,
HttpsFilter,
TrojanFilter,
Socks5Filter,
vmessFilter,
v2rayFilter,
snellFilter,
httpFilter,
httpsFilter,
trojanFilter,
socks5Filter,
} from '../utils/filter';
import { prependFlag } from '../utils/flag';

Expand Down Expand Up @@ -153,13 +153,13 @@ export class Artifact extends EventEmitter {
chinaBackFilter,
shadowsocksFilter,
shadowsocksrFilter,
VmessFilter,
V2rayFilter,
SnellFilter,
HttpFilter,
HttpsFilter,
TrojanFilter,
Socks5Filter,
vmessFilter,
v2rayFilter,
snellFilter,
httpFilter,
httpsFilter,
trojanFilter,
socks5Filter,
toUrlSafeBase64,
toBase64,
encodeURIComponent,
Expand Down
1 change: 0 additions & 1 deletion lib/generator/template.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import nunjucks from 'nunjucks';
import { JsonObject } from 'type-fest';
import YAML from 'yaml';
import { URL } from 'url';

import { decodeStringList, toBase64 } from '../utils';
import {
Expand Down
14 changes: 7 additions & 7 deletions lib/utils/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,16 @@ export const shadowsocksFilter: NodeNameFilterType = item => item.type === NodeT
// istanbul ignore next
export const shadowsocksrFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Shadowsocksr;
// istanbul ignore next
export const VmessFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Vmess;
export const vmessFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Vmess;
// istanbul ignore next
export const V2rayFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Vmess;
export const v2rayFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Vmess;
// istanbul ignore next
export const SnellFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Snell;
export const snellFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Snell;
// istanbul ignore next
export const HttpFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.HTTP;
export const httpFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.HTTP;
// istanbul ignore next
export const HttpsFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.HTTPS;
export const httpsFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.HTTPS;
// istanbul ignore next
export const TrojanFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Trojan;
export const trojanFilter: NodeNameFilterType = item => item.type === NodeTypeEnum.Trojan;
// istanbul ignore next
export const Socks5Filter: NodeNameFilterType = item => item.type === NodeTypeEnum.Socks5;
export const socks5Filter: NodeNameFilterType = item => item.type === NodeTypeEnum.Socks5;

0 comments on commit 6aa6531

Please sign in to comment.