MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / getCommandPolicy

Function getCommandPolicy

src/utils/abuseProtection.js:50–60  ·  view source on GitHub ↗
(command)

Source from the content-addressed store, hash-verified

48}
49
50function getCommandPolicy(command) {
51 const protection = command?.abuseProtection || {};
52 const maxAttempts = Number.isInteger(protection.maxAttempts) && protection.maxAttempts > 0
53 ? protection.maxAttempts
54 : DEFAULT_PROTECTION_POLICY.maxAttempts;
55 const windowMs = Number.isInteger(protection.windowMs) && protection.windowMs > 0
56 ? protection.windowMs
57 : DEFAULT_PROTECTION_POLICY.windowMs;
58
59 return { maxAttempts, windowMs };
60}
61
62function getAnomalyPolicy(command) {
63 const anomaly = command?.abuseProtection?.anomaly || {};

Callers 1

enforceAbuseProtectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected