MCPcopy Create free account
hub / github.com/FxEmbed/FxEmbed / pickFloat

Function pickFloat

packages/atmosphere/src/providers/threads/processor.ts:19–28  ·  view source on GitHub ↗
(...vals: unknown[])

Source from the content-addressed store, hash-verified

17}
18
19function pickFloat(...vals: unknown[]): number {
20 for (const v of vals) {
21 if (typeof v === 'number' && Number.isFinite(v)) return v;
22 if (typeof v === 'string' && v.trim() !== '') {
23 const n = Number(v);
24 if (Number.isFinite(n)) return n;
25 }
26 }
27 return Number.NaN;
28}
29
30function isoFromUnix(sec: number): string {
31 if (!Number.isFinite(sec) || sec <= 0) return new Date(0).toISOString();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected