Skip to content

deno-library/isuuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isuuid

JSR Version

uuid check for Deno

Useage

import isuuid from "jsr:@deno-library/isuuid";
// or
// import isuuid from "https://deno.land/x/[email protected]/mod.ts";

const str = "5d86c74a-c111-11ea-a575-02fcdc4e7412"; // v1

isuuid(str); // is uuid    : true
isuuid(v1, 1); // is uuid v1 : true
isuuid(v1, 2); // is uuid v2 : false
isuuid(v1, 3); // is uuid v3 : false
isuuid(v1, 4); // is uuid v4 : false
isuuid(v1, 5); // is uuid v5 : false

Interface

type Version = 1 | 2 | 3 | 4 | 5;

interface isuuid {
  (str: string, version?: Version): boolean;
}

Test

deno test