mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-17 15:23:36 +01:00
Enable tsconfig noUncheckedIndexedAccess
This commit is contained in:
@@ -8,6 +8,11 @@ import { isServiceIdString } from './ServiceId.std.js';
|
||||
import type { AddressStringType } from './Address.std.js';
|
||||
import { Address } from './Address.std.js';
|
||||
|
||||
type QualifiedAddressMatch = RegExpMatchArray & {
|
||||
1: string;
|
||||
2: string;
|
||||
3: string;
|
||||
};
|
||||
const QUALIFIED_ADDRESS_REGEXP =
|
||||
/^((?:PNI:)?[:0-9a-f-]+):((?:PNI:)?[:0-9a-f-]+).(\d+)$/i;
|
||||
|
||||
@@ -41,7 +46,8 @@ export class QualifiedAddress {
|
||||
public static parse(value: string): QualifiedAddress {
|
||||
const match = value.match(QUALIFIED_ADDRESS_REGEXP);
|
||||
strictAssert(match != null, `Invalid QualifiedAddress: ${value}`);
|
||||
const [whole, ourServiceId, serviceId, deviceId] = match;
|
||||
const [whole, ourServiceId, serviceId, deviceId] =
|
||||
match as QualifiedAddressMatch;
|
||||
strictAssert(whole === value, 'Integrity check');
|
||||
strictAssert(
|
||||
isServiceIdString(ourServiceId),
|
||||
|
||||
Reference in New Issue
Block a user