mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-23 10:15:31 +08:00
chore: 优化文档,显示默认禁用
This commit is contained in:
20
src/file.ts
20
src/file.ts
@@ -87,6 +87,24 @@ export const checkConfig = (newConfig: SubscriptionConfig) => {
|
||||
throw new Error('invalid duplicated group key');
|
||||
}
|
||||
keys.add(g.key);
|
||||
|
||||
// check duplicated rule key
|
||||
const ruleKeys = new Set<number>();
|
||||
iArrayToArray(g.rules).forEach((r) => {
|
||||
if (typeof r == 'object' && r.key !== undefined) {
|
||||
if (ruleKeys.has(r.key)) {
|
||||
console.error({
|
||||
configName: newConfig.name,
|
||||
appId: app.id,
|
||||
groupName: g.name,
|
||||
groupKey: g.key,
|
||||
ruleKey: r.key,
|
||||
});
|
||||
throw new Error('invalid duplicated rule key');
|
||||
}
|
||||
ruleKeys.add(r.key);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -138,7 +156,7 @@ export const updateReadMeMd = async (newConfig: SubscriptionConfig) => {
|
||||
const groupMdText = app.groups
|
||||
?.map((group) => {
|
||||
const groupNameMdText =
|
||||
`- ${group.name}` +
|
||||
`- ${group.enable === false ? '默认禁用 ' : ''}**${group.name}**` +
|
||||
(group.desc ? ` - ${group.desc}` : '').trimEnd();
|
||||
|
||||
const exampleUrls: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user