1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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);