Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/uuid/mod.ts>validate

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function validate
import { validate } from "https://deno.land/std@0.191.0/uuid/mod.ts";

Test a string to see if it is a valid UUID.

import { validate } from "https://deno.land/std@0.191.0/uuid/mod.ts"

validate("not a UUID") // false
validate("6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b") // true

Parameters

uuid: string

Returns

boolean