mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Use shorter arrow functions where possible
For arrow functions that are both simple and short, we can avoid using explicit `return` to shorten them even further without hurting readability. For the `gulp mozcentral` build-target this reduces the overall size of the output by just under 1 kilo-byte (which isn't a lot but still can't hurt).
This commit is contained in:
parent
6e46304357
commit
9dfe9c552c
22 changed files with 78 additions and 169 deletions
|
@ -942,14 +942,10 @@ describe("api", function () {
|
|||
);
|
||||
|
||||
const loadingTask1 = getDocument(basicApiGetDocumentParams);
|
||||
const promise1 = loadingTask1.promise.then(pdfDoc => {
|
||||
return pdfDoc.numPages;
|
||||
});
|
||||
const promise1 = loadingTask1.promise.then(pdfDoc => pdfDoc.numPages);
|
||||
|
||||
const loadingTask2 = getDocument(tracemonkeyGetDocumentParams);
|
||||
const promise2 = loadingTask2.promise.then(pdfDoc => {
|
||||
return pdfDoc.numPages;
|
||||
});
|
||||
const promise2 = loadingTask2.promise.then(pdfDoc => pdfDoc.numPages);
|
||||
|
||||
const [numPages1, numPages2] = await Promise.all([promise1, promise2]);
|
||||
expect(numPages1).toEqual(3);
|
||||
|
@ -3901,9 +3897,9 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`)
|
|||
true
|
||||
);
|
||||
expect(
|
||||
currentImgData.data.every((value, index) => {
|
||||
return value === firstImgData.data[index];
|
||||
})
|
||||
currentImgData.data.every(
|
||||
(value, index) => value === firstImgData.data[index]
|
||||
)
|
||||
).toEqual(true);
|
||||
|
||||
if (i === NUM_PAGES_THRESHOLD) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue