MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / toInt

Function toInt

packages/oauth/src/managed-usage.ts:175–184  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

173}
174
175function toInt(value: unknown): number | null {
176 if (typeof value === 'number') {
177 return Number.isFinite(value) ? Math.trunc(value) : null;
178 }
179 if (typeof value === 'string') {
180 const n = Number(value);
181 return Number.isFinite(n) ? Math.trunc(n) : null;
182 }
183 return null;
184}
185
186// ── HTTP fetch ────────────────────────────────────────────────────────
187

Callers 3

toUsageRowFunction · 0.85
limitLabelFunction · 0.85
resetHintFromFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected