17ea2b58de
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
17 lines
561 B
TypeScript
17 lines
561 B
TypeScript
// Copyright 2023 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import { Aci, Pni, ServiceId } from '@signalapp/libsignal-client';
|
|
import type { AciString, PniString, ServiceIdString } from '../types/ServiceId';
|
|
|
|
export function toServiceIdObject(serviceId: ServiceIdString): ServiceId {
|
|
return ServiceId.parseFromServiceIdString(serviceId);
|
|
}
|
|
|
|
export function toAciObject(aci: AciString): Aci {
|
|
return Aci.parseFromServiceIdString(aci);
|
|
}
|
|
|
|
export function toPniObject(pni: PniString): Pni {
|
|
return Pni.parseFromServiceIdString(pni);
|
|
}
|