Read-only technical audit before the SaaS redesign: 13 reports, a logical anatomical-sheet JSON built from real horse data, verbatim copies of the 52 relevant source files, and a self-contained ZIP.
14 lines
387 B
TypeScript
14 lines
387 B
TypeScript
/**
|
|
* Generates a collision-resistant unique id using crypto.randomUUID().
|
|
* Falls back to a timestamp-based id in environments without crypto.
|
|
*/
|
|
export function generateId(): string {
|
|
if (
|
|
typeof crypto !== 'undefined' &&
|
|
typeof crypto.randomUUID === 'function'
|
|
) {
|
|
return crypto.randomUUID()
|
|
}
|
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
}
|