(field: unknown)
| 295 | } |
| 296 | |
| 297 | function readFieldNumber(field: unknown): number | undefined { |
| 298 | const parsed = fieldValueSchema.safeParse(field); |
| 299 | if (!parsed.success) return undefined; |
| 300 | const v = parsed.data.value; |
| 301 | if (typeof v === 'number' && Number.isFinite(v) && v >= 0) return Math.floor(v); |
| 302 | if (typeof v === 'string') { |
| 303 | const n = Number(v); |
| 304 | if (Number.isFinite(n) && n >= 0) return Math.floor(n); |
| 305 | } |
| 306 | return undefined; |
| 307 | } |
| 308 | |
| 309 | function buildContentDisposition(name: string, mediaType?: string): string { |
| 310 | // Media the browser can render (image/video/audio) is served `inline` so a |
no outgoing calls
no test coverage detected