MCPcopy Create free account
hub / github.com/ShipSecAI/studio / normaliseNumber

Function normaliseNumber

worker/src/components/security/httpx.ts:545–558  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

543}
544
545function normaliseNumber(value: unknown): number | null {
546 if (typeof value === 'number' && Number.isFinite(value)) {
547 return value;
548 }
549 if (typeof value === 'string') {
550 const trimmed = value.trim();
551 if (trimmed.length === 0) {
552 return null;
553 }
554 const parsed = Number.parseFloat(trimmed);
555 return Number.isFinite(parsed) ? parsed : null;
556 }
557 return null;
558}
559
560function normaliseString(value: unknown): string | null {
561 if (typeof value === 'string') {

Callers 1

parseHttpxOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected