MCPcopy
hub / github.com/ilyhalight/voice-over-translation / normalizePositiveMs

Function normalizePositiveMs

src/utils/intervalIdleChecker.ts:45–53  ·  view source on GitHub ↗
(
  value: number | undefined,
  fallback: number,
)

Source from the content-addressed store, hash-verified

43};
44
45function normalizePositiveMs(
46 value: number | undefined,
47 fallback: number,
48): number {
49 if (typeof value !== "number" || !Number.isFinite(value)) {
50 return fallback;
51 }
52 return Math.max(1, Math.trunc(value));
53}
54
55function normalizeNonNegativeMs(
56 value: number | undefined,

Callers 1

normalizeProfileFunction · 0.85

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected