Spaces:
Sleeping
Sleeping
Download src/lib/utils.ts from CosmicMagnetar/opentriage-api: direct link, hf CLI and curl.
- Browser
- Download file 335 Bytes
-
https://huggingface.co/spaces/CosmicMagnetar/opentriage-api/resolve/main/src/lib/utils.ts
- Command line
-
hf download hf://spaces/CosmicMagnetar/opentriage-api/src/lib/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/CosmicMagnetar/opentriage-api/resolve/main/src/lib/utils.ts
335 Bytes
| import { v4 as uuidv4 } from "uuid"; | |
| /** | |
| * Generates a UUID string for use as primary keys. | |
| * Preserves the same format as the Python backend. | |
| */ | |
| export function generateId(): string { | |
| return uuidv4(); | |
| } | |
| /** | |
| * Returns the current ISO 8601 timestamp. | |
| */ | |
| export function now(): string { | |
| return new Date().toISOString(); | |
| } | |