Autoformat using Prettier

pull/1/head
Daniel Gasienica 8 years ago
parent 320a8d31c1
commit 648a7ab1bb

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

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

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

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

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

Loading…
Cancel
Save