Re-format the code to account for prettier and globals updates

The `prettier` update slightly changed the formatting of some await-expressions; please see https://github.com/prettier/prettier/blob/main/CHANGELOG.md#302

The `globals` update removed the need for some eslint-disable statements; please see https://github.com/sindresorhus/globals/releases/tag/v13.21.0
This commit is contained in:
Jonas Jenwald 2023-08-19 09:08:54 +02:00
parent c5ebfa51a7
commit 4d19db0b19
4 changed files with 22 additions and 34 deletions

View File

@ -646,9 +646,8 @@ class Page {
}
async getStructTree() {
const structTreeRoot = await this.pdfManager.ensureCatalog(
"structTreeRoot"
);
const structTreeRoot =
await this.pdfManager.ensureCatalog("structTreeRoot");
if (!structTreeRoot) {
return null;
}

View File

@ -63,13 +63,11 @@ async function writeStream(stream, buffer, transform) {
const MIN_LENGTH_FOR_COMPRESSING = 256;
if (
// eslint-disable-next-line no-undef
typeof CompressionStream !== "undefined" &&
(string.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode)
) {
try {
const byteArray = stringToBytes(string);
// eslint-disable-next-line no-undef
const cs = new CompressionStream("deflate");
const writer = cs.writable.getWriter();
writer.write(byteArray);

View File

@ -722,9 +722,8 @@ describe("pdf_find_controller", function () {
pending("Linked test-cases are not supported in Node.js.");
}
const { eventBus, pdfFindController } = await initPdfFindController(
"issue14562.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("issue14562.pdf");
await testSearch({
eventBus,
@ -762,9 +761,8 @@ describe("pdf_find_controller", function () {
});
it("performs a search in a text containing some Hangul syllables", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"bug1771477.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("bug1771477.pdf");
await testSearch({
eventBus,
@ -783,9 +781,8 @@ describe("pdf_find_controller", function () {
});
it("performs a search in a text containing an ideographic at the end of a line", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"issue15340.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("issue15340.pdf");
await testSearch({
eventBus,
@ -804,9 +801,8 @@ describe("pdf_find_controller", function () {
});
it("performs a search in a text containing fullwidth chars", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"issue15690.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("issue15690.pdf");
await testSearch({
eventBus,
@ -825,9 +821,8 @@ describe("pdf_find_controller", function () {
});
it("performs a search in a text with some Katakana at the end of a line", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"issue15759.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("issue15759.pdf");
await testSearch({
eventBus,
@ -862,9 +857,8 @@ describe("pdf_find_controller", function () {
pending("Linked test-cases are not supported in Node.js.");
}
const { eventBus, pdfFindController } = await initPdfFindController(
"issue12909.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("issue12909.pdf");
await testSearch({
eventBus,
@ -896,9 +890,8 @@ describe("pdf_find_controller", function () {
});
it("performs a search in a text with some Hiragana diacritics at the end of a line", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"issue16063.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("issue16063.pdf");
await testSearch({
eventBus,
@ -936,9 +929,8 @@ describe("pdf_find_controller", function () {
pending("Linked test-cases are not supported in Node.js.");
}
const { eventBus, pdfFindController } = await initPdfFindController(
"bug1820909.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("bug1820909.pdf");
await testSearch({
eventBus,
@ -957,9 +949,8 @@ describe("pdf_find_controller", function () {
});
it("performs a search in a text with some UTF-32 chars followed by a dash at the end of a line", async function () {
const { eventBus, pdfFindController } = await initPdfFindController(
"bug1820909.1.pdf"
);
const { eventBus, pdfFindController } =
await initPdfFindController("bug1820909.1.pdf");
await testSearch({
eventBus,

View File

@ -505,8 +505,8 @@ class PDFLinkService {
*/
async executeSetOCGState(action) {
const pdfDocument = this.pdfDocument;
const optionalContentConfig = await this.pdfViewer
.optionalContentConfigPromise;
const optionalContentConfig =
await this.pdfViewer.optionalContentConfigPromise;
if (pdfDocument !== this.pdfDocument) {
return; // The document was closed while the optional content resolved.