()
| 2 | |
| 3 | // 🆕 Simple UUID generator for client-side message IDs |
| 4 | export const generateUUID = () => { |
| 5 | if (typeof window !== 'undefined' && window.crypto && window.crypto.randomUUID) { |
| 6 | return window.crypto.randomUUID(); |
| 7 | } |
| 8 | // Fallback for older browsers or non-secure contexts |
| 9 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { |
| 10 | const r = (Math.random() * 16) | 0; |
| 11 | const v = c === 'x' ? r : (r & 0x3) | 0x8; |
| 12 | return v.toString(16); |
| 13 | }); |
| 14 | }; |
| 15 | |
| 16 | export interface Step { |
| 17 | key: string; |
no outgoing calls
no test coverage detected