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

Function parseLimitFromParts

cy/cy.ts:91–95  ·  view source on GitHub ↗
(parts: string[])

Source from the content-addressed store, hash-verified

89}
90
91function parseLimitFromParts(parts: string[]): number {
92 const value = Number(parts[0]);
93 if (!Number.isFinite(value) || value <= 0) return DEFAULT_LIMIT;
94 return Math.max(50, Math.min(MAX_LIMIT, Math.floor(value)));
95}
96
97function normalizeLimit(value: unknown, fallback = DEFAULT_LIMIT): number {
98 const num = Number(value);

Callers 1

CyPluginClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected