tslint arrow-parens rule (#4003)

This commit is contained in:
Eugenio Romano
2018-11-23 01:06:56 +00:00
committed by GitHub
parent 51bb6a420f
commit 34a30c0f14
194 changed files with 725 additions and 723 deletions

View File

@@ -85,8 +85,8 @@ describe('PdfThumbListComponent', () => {
fixture.nativeElement.scrollTop = 0;
fixture.detectChanges();
const renderedIds = component.renderItems.map(item => item.id);
const rangeIds = viewerMock._pages.slice(0, 6).map(item => item.id);
const renderedIds = component.renderItems.map((item) => item.id);
const rangeIds = viewerMock._pages.slice(0, 6).map((item) => item.id);
expect(renderedIds).toEqual(rangeIds);
});
@@ -96,8 +96,8 @@ describe('PdfThumbListComponent', () => {
fixture.nativeElement.scrollTop = 700;
fixture.detectChanges();
const renderedIds = component.renderItems.map(item => item.id);
const rangeIds = viewerMock._pages.slice(5, 12).map(item => item.id);
const renderedIds = component.renderItems.map((item) => item.id);
const rangeIds = viewerMock._pages.slice(5, 12).map((item) => item.id);
expect(renderedIds).toEqual(rangeIds);
});
@@ -105,13 +105,13 @@ describe('PdfThumbListComponent', () => {
it('should render items containing current document page', () => {
fixture.detectChanges();
const renderedIds = component.renderItems.map(item => item.id);
const renderedIds = component.renderItems.map((item) => item.id);
expect(renderedIds).not.toContain(10);
component.scrollInto(10);
const newRenderedIds = component.renderItems.map(item => item.id);
const newRenderedIds = component.renderItems.map((item) => item.id);
expect(newRenderedIds).toContain(10);
});
@@ -120,14 +120,14 @@ describe('PdfThumbListComponent', () => {
fixture.nativeElement.scrollTop = 1700;
fixture.detectChanges();
const renderedIds = component.renderItems.map(item => item.id);
const renderedIds = component.renderItems.map((item) => item.id);
expect(renderedIds).toContain(12);
/* cspell:disable-next-line */
viewerMock.eventBus.dispatch('pagechange', { pageNumber: 12 });
const newRenderedIds = component.renderItems.map(item => item.id);
const newRenderedIds = component.renderItems.map((item) => item.id);
expect(newRenderedIds).toContain(12);
});

View File

@@ -251,7 +251,7 @@ describe('Test PdfViewer component', () => {
let componentBlobTestComponent: BlobTestComponent;
let elementBlobTestComponent: HTMLElement;
beforeEach(done => {
beforeEach((done) => {
fixtureBlobTestComponent = TestBed.createComponent(BlobTestComponent);
componentBlobTestComponent = fixtureBlobTestComponent.componentInstance;
elementBlobTestComponent = fixtureBlobTestComponent.nativeElement;

View File

@@ -417,7 +417,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
disableClose: true,
data: { reason }
})
.afterClosed().subscribe(password => {
.afterClosed().subscribe((password) => {
if (password) {
callback(password);
}

View File

@@ -58,7 +58,7 @@ export class TxtViewerComponent implements OnChanges {
private getUrlContent(url: string): Promise<any> {
return new Promise((resolve, reject) => {
this.http.get(url, { responseType: 'text' }).subscribe(res => {
this.http.get(url, { responseType: 'text' }).subscribe((res) => {
this.content = res;
resolve();
}, (event) => {

View File

@@ -569,7 +569,7 @@ describe('ViewerComponent', () => {
component.fileName = 'fileName';
fixture.detectChanges();
component.download.subscribe(e => {
component.download.subscribe((e) => {
expect(e).not.toBeNull();
done();
});
@@ -617,7 +617,7 @@ describe('ViewerComponent', () => {
component.allowPrint = true;
fixture.detectChanges();
component.print.subscribe(e => {
component.print.subscribe((e) => {
expect(e).not.toBeNull();
done();
});
@@ -665,7 +665,7 @@ describe('ViewerComponent', () => {
component.allowShare = true;
fixture.detectChanges();
component.share.subscribe(e => {
component.share.subscribe((e) => {
expect(e).not.toBeNull();
done();
});

View File

@@ -288,12 +288,12 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
ngOnInit() {
this.subscriptions.push(
this.apiService.nodeUpdated.subscribe(node => this.onNodeUpdated(node))
this.apiService.nodeUpdated.subscribe((node) => this.onNodeUpdated(node))
);
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}
@@ -335,7 +335,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
} else if (this.sharedLinkId) {
this.apiService.sharedLinksApi.getSharedLink(this.sharedLinkId).then(
details => {
(details) => {
this.setUpSharedLinkFile(details);
this.isLoading = false;
},
@@ -710,10 +710,10 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
const supported = await this.apiService.renditionsApi.getRenditions(nodeId);
let rendition = supported.list.entries.find(obj => obj.entry.id.toLowerCase() === renditionId);
let rendition = supported.list.entries.find((obj) => obj.entry.id.toLowerCase() === renditionId);
if (!rendition) {
renditionId = 'imgpreview';
rendition = supported.list.entries.find(obj => obj.entry.id.toLowerCase() === renditionId);
rendition = supported.list.entries.find((obj) => obj.entry.id.toLowerCase() === renditionId);
}
if (rendition) {