Fix the inconsistent return type of the PDFDocument.isPureXfa getter

Also (slightly) simplifies a couple of small getters/methods related to the `XFAFactory`-instance.
This commit is contained in:
Jonas Jenwald 2021-10-16 12:28:48 +02:00
parent cd94a44ca1
commit 0e5348180e

View File

@ -900,14 +900,11 @@ class PDFDocument {
}
get isPureXfa() {
return this.xfaFactory && this.xfaFactory.isValid();
return this.xfaFactory ? this.xfaFactory.isValid() : false;
}
get htmlForXfa() {
if (this.xfaFactory) {
return this.xfaFactory.getPages();
}
return null;
return this.xfaFactory ? this.xfaFactory.getPages() : null;
}
async loadXfaImages() {
@ -1088,10 +1085,9 @@ class PDFDocument {
}
async serializeXfaData(annotationStorage) {
if (this.xfaFactory) {
return this.xfaFactory.serializeData(annotationStorage);
}
return null;
return this.xfaFactory
? this.xfaFactory.serializeData(annotationStorage)
: null;
}
get formInfo() {