Fix UUID Regex when normalizing serviceIds
This commit is contained in:
parent
0eb4bd86bd
commit
402b256c66
1 changed files with 2 additions and 1 deletions
|
@ -1,8 +1,9 @@
|
||||||
// Copyright 2023 Signal Messenger, LLC
|
// Copyright 2023 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
// [47] to support v4 and v7 uuids
|
||||||
const UUID_REGEXP =
|
const UUID_REGEXP =
|
||||||
/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
|
/^[0-9A-F]{8}-[0-9A-F]{4}-[47][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
|
||||||
|
|
||||||
export const isValidUuid = (value: unknown): value is string => {
|
export const isValidUuid = (value: unknown): value is string => {
|
||||||
if (typeof value !== 'string') {
|
if (typeof value !== 'string') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue