Add eqeqeq rule but require == for null

This commit is contained in:
Jamie Kyle 2022-09-14 14:40:44 -07:00 committed by GitHub
parent 64a4d2e717
commit 0086216c9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 64 additions and 63 deletions

View file

@ -19,7 +19,7 @@ export class Address {
public static parse(value: string): Address {
const match = value.match(ADDRESS_REGEXP);
strictAssert(match !== null, `Invalid Address: ${value}`);
strictAssert(match != null, `Invalid Address: ${value}`);
const [whole, uuid, deviceId] = match;
strictAssert(whole === value, 'Integrity check');
return Address.create(uuid, parseInt(deviceId, 10));

View file

@ -39,7 +39,7 @@ export class QualifiedAddress {
public static parse(value: string): QualifiedAddress {
const match = value.match(QUALIFIED_ADDRESS_REGEXP);
strictAssert(match !== null, `Invalid QualifiedAddress: ${value}`);
strictAssert(match != null, `Invalid QualifiedAddress: ${value}`);
const [whole, ourUuid, uuid, deviceId] = match;
strictAssert(whole === value, 'Integrity check');

View file

@ -319,7 +319,7 @@ async function downloadSticker(
{ ephemeral }: { ephemeral?: boolean } = {}
): Promise<Omit<StickerFromDBType, 'isCoverOnly'>> {
const { id, emoji } = proto;
strictAssert(id !== undefined && id !== null, "Sticker id can't be null");
strictAssert(id != null, "Sticker id can't be null");
const { messaging } = window.textsecure;
if (!messaging) {