mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Replace some ternary operators with optional chaining, and nullish coalescing, in the src/display/
-folder
This way, we can further reduce unnecessary code-repetition in some cases.
This commit is contained in:
parent
172abc02e1
commit
298ee5cfbb
7 changed files with 8 additions and 14 deletions
|
@ -2605,7 +2605,7 @@ class WorkerTransport {
|
|||
.sendWithPromise("SaveDocument", {
|
||||
numPages: this._numPages,
|
||||
annotationStorage: annotationStorage?.getAll() || null,
|
||||
filename: this._fullReader ? this._fullReader.filename : null,
|
||||
filename: this._fullReader?.filename ?? null,
|
||||
})
|
||||
.finally(() => {
|
||||
if (annotationStorage) {
|
||||
|
@ -2800,7 +2800,7 @@ class PDFObjects {
|
|||
|
||||
has(objId) {
|
||||
const obj = this._objs[objId];
|
||||
return obj ? obj.resolved : false;
|
||||
return obj?.resolved || false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue