diff options
Diffstat (limited to 'std/uuid/v5.ts')
-rw-r--r-- | std/uuid/v5.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/std/uuid/v5.ts b/std/uuid/v5.ts index f982d9745..6375e7bab 100644 --- a/std/uuid/v5.ts +++ b/std/uuid/v5.ts @@ -10,7 +10,8 @@ import { Sha1 } from "../hash/sha1.ts"; import { isString } from "../node/util.ts"; import { assert } from "../_util/assert.ts"; -const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; +const UUID_RE = + /^[0-9a-f]{8}-[0-9a-f]{4}-[5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; export function validate(id: string): boolean { return UUID_RE.test(id); @@ -24,7 +25,7 @@ interface V5Options { export function generate( options: V5Options, buf?: number[], - offset?: number + offset?: number, ): string | number[] { const i = (buf && offset) || 0; @@ -33,7 +34,7 @@ export function generate( if (isString(namespace)) namespace = uuidToBytes(namespace as string); assert( namespace.length === 16, - "namespace must be uuid string or an Array of 16 byte values" + "namespace must be uuid string or an Array of 16 byte values", ); const content = (namespace as number[]).concat(value as number[]); |