Reduce some duplication for AppOptions that use compatibilityParams
We can check for a relevant `compatibilityParams`-entry directly in `AppOptions.{get, getAll}` instead, which removes some unnecessary duplication.
This commit is contained in:
parent
df79b18a31
commit
a19feac217
@ -137,7 +137,6 @@ const defaultOptions = {
|
||||
maxCanvasPixels: {
|
||||
/** @type {number} */
|
||||
value: 16777216,
|
||||
compatibility: compatibilityParams.maxCanvasPixels,
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
pageColorsBackground: {
|
||||
@ -314,9 +313,6 @@ if (
|
||||
: "../build/pdf.sandbox.js",
|
||||
kind: OptionKind.VIEWER,
|
||||
};
|
||||
|
||||
defaultOptions.annotationEditorEnabled.compatibility =
|
||||
compatibilityParams.annotationEditorEnabled;
|
||||
} else if (PDFJSDev.test("CHROME")) {
|
||||
defaultOptions.disableTelemetry = {
|
||||
/** @type {boolean} */
|
||||
@ -344,7 +340,7 @@ class AppOptions {
|
||||
}
|
||||
const defaultOption = defaultOptions[name];
|
||||
if (defaultOption !== undefined) {
|
||||
return defaultOption.compatibility ?? defaultOption.value;
|
||||
return compatibilityParams[name] ?? defaultOption.value;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
@ -376,7 +372,7 @@ class AppOptions {
|
||||
options[name] =
|
||||
userOption !== undefined
|
||||
? userOption
|
||||
: defaultOption.compatibility ?? defaultOption.value;
|
||||
: compatibilityParams[name] ?? defaultOption.value;
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user