signal-desktop/ts/util/normalizeUuid.ts
2021-06-22 16:08:55 -07:00

14 lines
369 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from './assert';
import { isValidGuid } from './isValidGuid';
export function normalizeUuid(uuid: string, context: string): string {
assert(
isValidGuid(uuid),
`Normalizing invalid uuid: ${uuid} in context "${context}"`
);
return uuid.toLowerCase();
}