Enable brace-style eslint rules
This commit is contained in:
parent
73bdcdfd0a
commit
5a8f484a03
9 changed files with 54 additions and 13 deletions
|
@ -30,12 +30,15 @@ export type ModifiedGroupDetails = MessageWithAvatar<Proto.GroupDetails>;
|
|||
|
||||
export type ModifiedContactDetails = MessageWithAvatar<Proto.ContactDetails>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/brace-style -- Prettier conflicts with ESLint */
|
||||
abstract class ParserBase<
|
||||
Message extends OptionalAvatar,
|
||||
Decoder extends DecoderBase<Message>,
|
||||
Result
|
||||
> implements Iterable<Result>
|
||||
{
|
||||
/* eslint-enable @typescript-eslint/brace-style */
|
||||
|
||||
protected readonly reader: protobuf.Reader;
|
||||
|
||||
constructor(bytes: Uint8Array, private readonly decoder: Decoder) {
|
||||
|
|
|
@ -229,10 +229,13 @@ function getEnvelopeId(envelope: ProcessedEnvelope): string {
|
|||
return `${prefix} ${timestamp} (${envelope.id})`;
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/brace-style -- Prettier conflicts with ESLint */
|
||||
export default class MessageReceiver
|
||||
extends EventTarget
|
||||
implements IRequestHandler
|
||||
{
|
||||
/* eslint-enable @typescript-eslint/brace-style */
|
||||
|
||||
private server: WebAPIType;
|
||||
|
||||
private storage: Storage;
|
||||
|
|
|
@ -55,14 +55,18 @@ export class User {
|
|||
|
||||
public getNumber(): string | undefined {
|
||||
const numberId = this.storage.get('number_id');
|
||||
if (numberId === undefined) return undefined;
|
||||
if (numberId === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return Helpers.unencodeNumber(numberId)[0];
|
||||
}
|
||||
|
||||
public getUuid(uuidKind = UUIDKind.ACI): UUID | undefined {
|
||||
if (uuidKind === UUIDKind.PNI) {
|
||||
const pni = this.storage.get('pni');
|
||||
if (pni === undefined) return undefined;
|
||||
if (pni === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return new UUID(pni);
|
||||
}
|
||||
|
||||
|
@ -71,7 +75,9 @@ export class User {
|
|||
`Unsupported uuid kind: ${uuidKind}`
|
||||
);
|
||||
const uuid = this.storage.get('uuid_id');
|
||||
if (!uuid) return undefined;
|
||||
if (!uuid) {
|
||||
return undefined;
|
||||
}
|
||||
return new UUID(Helpers.unencodeNumber(uuid.toLowerCase())[0]);
|
||||
}
|
||||
|
||||
|
@ -161,13 +167,17 @@ export class User {
|
|||
|
||||
private _getDeviceIdFromUuid(): string | undefined {
|
||||
const uuid = this.storage.get('uuid_id');
|
||||
if (uuid === undefined) return undefined;
|
||||
if (uuid === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return Helpers.unencodeNumber(uuid)[1];
|
||||
}
|
||||
|
||||
private _getDeviceIdFromNumber(): string | undefined {
|
||||
const numberId = this.storage.get('number_id');
|
||||
if (numberId === undefined) return undefined;
|
||||
if (numberId === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return Helpers.unencodeNumber(numberId)[1];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue