(value: unknown)
| 39 | // Object]", so keep this richer JSON fallback for that path. Keyframe values are |
| 40 | // always number|string and use the shared serializeValue (recast parity). |
| 41 | function valueToCode(value: unknown): string { |
| 42 | if (typeof value === "string" && value.startsWith("__raw:")) return value.slice(6); |
| 43 | if (typeof value === "string") return JSON.stringify(value); |
| 44 | if (typeof value === "number") return Number.isNaN(value) ? "0" : String(value); |
| 45 | if (typeof value === "boolean") return String(value); |
| 46 | return JSON.stringify(value); |
| 47 | } |
| 48 | |
| 49 | function safeKey(key: string): string { |
| 50 | return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : JSON.stringify(key); |
no outgoing calls
no test coverage detected