validate

import { validate } from "jsr:@ende/uuid/v5";

function

function validate(id: string): boolean

Determines whether a string is a valid UUIDv5.

id: string

UUID value.

Returns

true if the string is a valid UUIDv5, otherwise false.

Example: Usage

import { validate } from "@ende/uuid/v5";
import { assert, assertFalse } from "@ende/assert";

assert(validate("7af94e2b-4dd9-50f0-9c9a-8a48519bdef0"));
assertFalse(validate(crypto.randomUUID()));

Source