mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-15 18:45:59 +00:00
better random, improved map
This commit is contained in:
@@ -97,4 +97,11 @@ export function getMode(list: string[]): string {
|
||||
}
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
export function generateUniqueId(): string {
|
||||
if (typeof crypto === 'undefined' || !crypto.randomUUID) {
|
||||
throw new Error('crypto.randomUUID is not supported in this environment');
|
||||
}
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
Reference in New Issue
Block a user