Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Functions

Const isUuid

  • isUuid(val: string): boolean
  • Checks for a valid UUID (v1, v3, v4, v5) string.

    example

    isUuid('b7557270-735b-11ea-9135-cb86b071733e'); // true (v1) isUuid('0d0b682a-57ef-3539-94af-70e6678afe40'); // true (v3) isUuid('c39b9935-8374-4ea0-b76b-7313dc929be7'); // true (v4) isUuid('2bd4ebf8-85a4-5add-b18c-eff4bd14a13a'); // true (v5) isUuid('foo-2bd4ebf8-85a4-5add-b18c-eff4bd14a13a-bar'); // false isUuid('not uuid'); // false isUuid('12345'); // false

    Parameters

    • val: string

      The value to check.

    Returns boolean

    Whether the value is an UUID string.

Legend

  • Function

Generated using TypeDoc