Merge pull request #21018 from Snuffleupagus/Node-22

[api-minor] Update the minimum supported Node.js version to 22
This commit is contained in:
Jonas Jenwald 2026-04-05 12:39:36 +02:00 committed by GitHub
commit 5aaf30a071
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 19 deletions

View File

@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24, 25]
node-version: [22, 24, 25]
steps:
- name: Checkout repository

View File

@ -87,7 +87,7 @@ const ENV_TARGETS = [
"Chrome >= 118",
"Firefox ESR",
"Safari >= 16.4",
"Node >= 20",
"Node >= 22",
"> 1%",
"not IE > 0",
"not dead",
@ -2500,7 +2500,7 @@ function packageJson() {
url: `git+${DIST_GIT_URL}`,
},
engines: {
node: ">=20.19.0 || >=22.13.0 || >=24",
node: ">=22.13.0 || >=24",
},
scripts: {},
};

2
package-lock.json generated
View File

@ -71,7 +71,7 @@
"webpack-stream": "^7.0.0"
},
"engines": {
"node": ">=20.19.0 || >=22.13.0 || >=24"
"node": ">=22.13.0 || >=24"
}
},
"node_modules/@babel/code-frame": {

View File

@ -70,7 +70,7 @@
"url": "git://github.com/mozilla/pdf.js.git"
},
"engines": {
"node": ">=20.19.0 || >=22.13.0 || >=24"
"node": ">=22.13.0 || >=24"
},
"license": "Apache-2.0"
}

View File

@ -14,20 +14,7 @@
*/
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
// eslint-disable-next-line no-var
var compatParams = new Map();
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("LIB") &&
!globalThis.navigator?.language
) {
globalThis.navigator = {
language: "en-US",
maxTouchPoints: 1,
platform: "",
userAgent: "",
};
}
var compatParams = new Map(); // eslint-disable-line no-var
const { maxTouchPoints, platform, userAgent } = navigator;
const isAndroid = /Android/.test(userAgent);