Upgrade Prettier to 2.4.1

This commit is contained in:
Evan Hahn 2021-11-11 16:43:05 -06:00 committed by GitHub
parent f204784afe
commit 5619eeca83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
176 changed files with 1961 additions and 2465 deletions

View file

@ -396,10 +396,10 @@ export async function captureDimensionsAndScreenshot(
contentType: MIME.MIMEType
) => string;
revokeObjectUrl: (path: string) => void;
getImageDimensions: (params: {
objectUrl: string;
logger: LoggerType;
}) => { width: number; height: number };
getImageDimensions: (params: { objectUrl: string; logger: LoggerType }) => {
width: number;
height: number;
};
makeImageThumbnail: (params: {
size: number;
objectUrl: string;

View file

@ -16,7 +16,8 @@ export type QualifiedAddressCreateOptionsType = Readonly<{
deviceId: number;
}>;
export type QualifiedAddressStringType = `${UUIDStringType}:${AddressStringType}`;
export type QualifiedAddressStringType =
`${UUIDStringType}:${AddressStringType}`;
export class QualifiedAddress {
constructor(

View file

@ -374,11 +374,8 @@ export async function downloadEphemeralPack(
packId: string,
packKey: string
): Promise<void> {
const {
stickerAdded,
stickerPackAdded,
stickerPackUpdated,
} = getReduxStickerActions();
const { stickerAdded, stickerPackAdded, stickerPackUpdated } =
getReduxStickerActions();
const existingPack = getStickerPack(packId);
if (
@ -762,13 +759,10 @@ export async function copyStickerToAttachments(
}
const { path: stickerPath } = sticker;
const absolutePath = window.Signal.Migrations.getAbsoluteStickerPath(
stickerPath
);
const {
path,
size,
} = await window.Signal.Migrations.copyIntoAttachmentsDirectory(absolutePath);
const absolutePath =
window.Signal.Migrations.getAbsoluteStickerPath(stickerPath);
const { path, size } =
await window.Signal.Migrations.copyIntoAttachmentsDirectory(absolutePath);
const { data } = await window.Signal.Migrations.loadAttachmentData({
path,

View file

@ -5,7 +5,8 @@ import { v4 as generateUUID } from 'uuid';
import { strictAssert } from '../util/assert';
export type UUIDStringType = `${string}-${string}-${string}-${string}-${string}`;
export type UUIDStringType =
`${string}-${string}-${string}-${string}-${string}`;
export const isValidUuid = (value: unknown): value is UUIDStringType =>
typeof value === 'string' &&

View file

@ -42,13 +42,12 @@ type InternalAssertProps<
Missing = Omit<Result, keyof Value>
> = keyof Missing extends never
? Result
: Result &
{
[key in keyof Required<Missing>]: [
never,
'AssertProps: missing property'
];
};
: Result & {
[key in keyof Required<Missing>]: [
never,
'AssertProps: missing property'
];
};
export type AssertProps<Result, Value> = InternalAssertProps<Result, Value>;

View file

@ -5,10 +5,10 @@ import * as Attachment from '../Attachment';
import * as IndexedDB from '../IndexedDB';
import type { Message, UserMessage } from '../Message';
const hasAttachment = (
predicate: (value: Attachment.AttachmentType) => boolean
) => (message: UserMessage): IndexedDB.IndexablePresence =>
IndexedDB.toIndexablePresence(message.attachments.some(predicate));
const hasAttachment =
(predicate: (value: Attachment.AttachmentType) => boolean) =>
(message: UserMessage): IndexedDB.IndexablePresence =>
IndexedDB.toIndexablePresence(message.attachments.some(predicate));
const hasFileAttachment = hasAttachment(Attachment.isFile);
const hasVisualMediaAttachment = hasAttachment(Attachment.isVisualMedia);