Files
classroomio/apps/dashboard/src/lib/utils/functions/isUUID.ts
T

14 lines
259 B
TypeScript
Raw Normal View History

export function isUUID(uuid: string) {
2025-11-01 15:49:29 +01:00
const s = '' + uuid;
2021-08-18 19:47:02 +03: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}$'
);
if (m === null) {
2021-08-18 19:47:02 +03:00
return false;
}
2021-08-18 19:47:02 +03:00
return true;
}