Skip to content

Commit

Permalink
Add (some) optional chaining usage in src/display/api.js
Browse files Browse the repository at this point in the history
Since we no longer use SystemJS to load the unit-tests, there's now nothing that prevents us from using optional chaining and nullish coalescing in the `src/display/` directory.
  • Loading branch information
Snuffleupagus committed Oct 25, 2020
1 parent 953c95c commit 68d6c7c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1168,8 +1168,7 @@ class PDFPageProxy {
pageIndex: this._pageIndex,
intent: renderingIntent,
renderInteractiveForms: renderInteractiveForms === true,
annotationStorage:
(annotationStorage && annotationStorage.getAll()) || null,
annotationStorage: annotationStorage?.getAll() || null,
});
}

Expand Down Expand Up @@ -2551,8 +2550,7 @@ class WorkerTransport {
return this.messageHandler
.sendWithPromise("SaveDocument", {
numPages: this._numPages,
annotationStorage:
(annotationStorage && annotationStorage.getAll()) || null,
annotationStorage: annotationStorage?.getAll() || null,
filename: this._fullReader ? this._fullReader.filename : null,
})
.finally(() => {
Expand Down

0 comments on commit 68d6c7c

Please sign in to comment.