Determines whether a string is a valid UUID.
UUID value.
true if the string is a valid UUID, otherwise false.
true
false
import { validate } from "@std/uuid";import { assert, assertFalse } from "@std/assert";assert(validate("6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b"));assertFalse(validate("not a UUID")); Copy
import { validate } from "@std/uuid";import { assert, assertFalse } from "@std/assert";assert(validate("6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b"));assertFalse(validate("not a UUID"));
Determines whether a string is a valid UUID.