2022-12-30 13:08:54 +01:00
|
|
|
export function isUUID(uuid: string) {
|
2025-11-01 15:49:29 +01:00
|
|
|
const s = '' + uuid;
|
2021-08-18 19:47:02 +03:00
|
|
|
|
2022-12-30 13:08:54 +01:00
|
|
|
const m: RegExpMatchArray | null = s.match(
|
2021-08-18 19:47:02 +03:00
|
|
|
'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
|
|
|
|
|
);
|
2022-12-30 13:08:54 +01:00
|
|
|
|
|
|
|
|
if (m === null) {
|
2021-08-18 19:47:02 +03:00
|
|
|
return false;
|
|
|
|
|
}
|
2022-12-30 13:08:54 +01:00
|
|
|
|
2021-08-18 19:47:02 +03:00
|
|
|
return true;
|
|
|
|
|
}
|