Support for creating New Groups
This commit is contained in:
parent
1934120e46
commit
5de4babc0d
56 changed files with 6222 additions and 526 deletions
12
ts/util/parseIntWithFallback.ts
Normal file
12
ts/util/parseIntWithFallback.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { parseIntOrThrow } from './parseIntOrThrow';
|
||||
|
||||
export function parseIntWithFallback(value: unknown, fallback: number): number {
|
||||
try {
|
||||
return parseIntOrThrow(value, 'Failed to parse');
|
||||
} catch (err) {
|
||||
return fallback;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue