check-is-guid
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

isGuid

A small package for checking if a string is a valid GUID.

Installation

npm install check-is-guid
yarn add check-is-guid

Usage

const checkIsGuid = require('check-is-guid');

checkIsGuid('f4090a94-1774-46d7-b469-109ddec68cd2'); // true
checkIsGuid('f4090a94-1774-46d7-b469-109ddec68cd'); // false
import checkIsGuid from 'check-is-guid';

checkIsGuid('f4090a94-1774-46d7-b469-109ddec68cd2'); // true
checkIsGuid('f4090a94-1774-46d7-b469-109ddec68cd'); // false

Optional Arguments

Add an optional version argument to also confirm the GUID is a specific version.

checkIsGuid('f4090a94-1774-46d7-b469-109ddec68cd2', {version: 4}); // true
checkIsGuid('f4090a94-1774-46d7-b469-109ddec68cd2', {version: 5}); // false

Package Sidebar

Install

npm i check-is-guid

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

2.57 kB

Total Files

4

Last publish

Collaborators

  • ccp92