Support PNI in QualifiedAddress.parse

This commit is contained in:
Fedor Indutny
2023-12-07 22:52:27 +01:00
committed by GitHub
parent 0b629c9f70
commit 7bad05f5a0
3 changed files with 18 additions and 15 deletions

View File

@@ -8,7 +8,8 @@ import { isServiceIdString } from './ServiceId';
import type { AddressStringType } from './Address';
import { Address } from './Address';
const QUALIFIED_ADDRESS_REGEXP = /^([:0-9a-f-]+):([:0-9a-f-]+).(\d+)$/i;
const QUALIFIED_ADDRESS_REGEXP =
/^((?:PNI:)?[:0-9a-f-]+):((?:PNI:)?[:0-9a-f-]+).(\d+)$/i;
export type QualifiedAddressCreateOptionsType = Readonly<{
ourServiceId: ServiceIdString;