(val: unknown)
| 29 | } |
| 30 | |
| 31 | function toNumber(val: unknown): number { |
| 32 | if (typeof val === "number") return val; |
| 33 | if (typeof val === "string") { |
| 34 | const n = Number(val); |
| 35 | return isNaN(n) ? 0 : n; |
| 36 | } |
| 37 | if (typeof val === "boolean") return val ? 1 : 0; |
| 38 | return 0; |
| 39 | } |
| 40 | |
| 41 | export const BUILTINS: Record<string, BuiltinDef> = { |
| 42 | Count: { |
no outgoing calls
no test coverage detected