Autoformat using Prettier

This commit is contained in:
Daniel Gasienica 2018-04-13 22:09:56 -04:00
parent 320a8d31c1
commit 648a7ab1bb
5 changed files with 27 additions and 21 deletions

View File

@ -76,7 +76,7 @@ const toSection = (
case 'thisMonth':
return {
type: firstMessageWithSection.type,
messages: messages,
messages,
};
case 'yearMonth':
return {
@ -94,11 +94,11 @@ const toSection = (
}
};
type GenericMessageWithSection<T> = {
interface GenericMessageWithSection<T> {
order: number;
type: T;
message: Message;
};
}
type MessageWithStaticSection = GenericMessageWithSection<StaticSectionType>;
type MessageWithYearMonthSection = GenericMessageWithSection<
YearMonthSectionType

View File

@ -57,7 +57,7 @@ describe('HTML', () => {
},
];
TESTS.forEach((test) => {
TESTS.forEach(test => {
(test.skipped ? it.skip : it)(`should handle ${test.name}`, () => {
const preText = test.preText || 'Hello ';
const postText = test.postText || ' World!';

View File

@ -66,16 +66,20 @@ type SharedMessageProperties = Readonly<{
timestamp: number;
}>;
type ExpirationTimerUpdate = Readonly<{
expirationTimerUpdate?: Readonly<{
expireTimer: number;
fromSync: boolean;
source: string; // PhoneNumber
}>;
}>;
type ExpirationTimerUpdate = Partial<
Readonly<{
expirationTimerUpdate: Readonly<{
expireTimer: number;
fromSync: boolean;
source: string; // PhoneNumber
}>;
}>
>;
type Message4 = Partial<Readonly<{
hasAttachments: IndexableBoolean;
hasVisualMediaAttachments: IndexableBoolean;
hasFileAttachments: IndexableBoolean;
}>>;
type Message4 = Partial<
Readonly<{
hasAttachments: IndexableBoolean;
hasVisualMediaAttachments: IndexableBoolean;
hasFileAttachments: IndexableBoolean;
}>
>;

View File

@ -6,6 +6,6 @@ import { Model } from './Model';
export interface Collection<T> {
models: Array<Model<T>>;
// tslint:disable-next-line no-misused-new
new(): Collection<T>;
new (): Collection<T>;
fetch(options: object): JQuery.Deferred<any, any, any>;
}

View File

@ -8,18 +8,20 @@ import * as IndexedDB from '../IndexedDB';
import { Message } from '../Message';
export const initializeAttachmentMetadata = async (
message: Message,
message: Message
): Promise<Message> => {
if (message.type === 'verified-change') {
return message;
}
const hasAttachments = IndexedDB.toIndexableBoolean(message.attachments.length > 0);
const hasAttachments = IndexedDB.toIndexableBoolean(
message.attachments.length > 0
);
const [hasVisualMediaAttachments, hasFileAttachments] = partition(
message.attachments,
Attachment.isVisualMedia,
Attachment.isVisualMedia
)
.map((attachments) => attachments.length > 0)
.map(attachments => attachments.length > 0)
.map(IndexedDB.toIndexableBoolean);
return {