MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getMaxRuleId

Function getMaxRuleId

autodelcmd/autodelcmd.ts:69–75  ·  view source on GitHub ↗
(rules: CommandRule[])

Source from the content-addressed store, hash-verified

67 .map(r => parseInt(r.id || '0'))
68 .filter(id => !isNaN(id));
69
70 return existingIds.length > 0 ? Math.max(...existingIds) : 0;
71}
72
73// 生成规则唯一ID - 使用简单数字
74function generateRuleId(existingRules: CommandRule[]): string {
75 return (getMaxRuleId(existingRules) + 1).toString();
76}
77
78// 当前配置文件版本号

Callers 3

generateRuleIdFunction · 0.85
loadConfigMethod · 0.85
migrateConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected