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

std/uuid/mod.ts>v1.validate

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

Validates the UUID v1.

Examples

Example 1

import { validate } from "https://deno.land/std@0.218.0/uuid/v1.ts";

validate("ea71fc60-a713-11ee-af61-8349da24f689");  // true
validate("fac8c1e0-ad1a-4204-a0d0-8126ae84495d");  // false

Parameters

id: string

UUID value.

Returns

boolean