9 lines
279 B
TypeScript
9 lines
279 B
TypeScript
|
// Copyright 2017-2021 Signal Messenger, LLC
|
||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
||
|
export const isValidGuid = (value: unknown): value is string =>
|
||
|
typeof value === 'string' &&
|
||
|
/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(
|
||
|
value
|
||
|
);
|