( record: CommandSessionRecord | undefined, )
| 59 | record: CommandSessionRecord | undefined, |
| 60 | ): CommandSessionRecord | undefined; |
| 61 | function cloneSessionRecord( |
| 62 | record: CommandSessionRecord | undefined, |
| 63 | ): CommandSessionRecord | undefined { |
| 64 | if (!record) return undefined; |
| 65 | return { |
| 66 | ...record, |
| 67 | ...(record.snapshot ? { snapshot: structuredClone(record.snapshot) } : {}), |
| 68 | ...(record.metadata ? { metadata: cloneMetadata(record.metadata) } : {}), |
| 69 | }; |
| 70 | } |
| 71 | |
| 72 | function cloneMetadata(metadata: Record<string, unknown>): Record<string, unknown> { |
| 73 | try { |
no test coverage detected