Polyfill Promise.withResolvers and upgrade to Node 22 base image
This commit is contained in:
parent
072d0483bd
commit
0edacd59da
2 changed files with 12 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
FROM node:20-bookworm-slim
|
FROM node:22-bookworm-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,17 @@ if (typeof globalThis.WebSocket === "undefined") {
|
||||||
globalThis.WebSocket = WebSocket;
|
globalThis.WebSocket = WebSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof Promise.withResolvers === "undefined") {
|
||||||
|
Promise.withResolvers = function () {
|
||||||
|
let resolve, reject;
|
||||||
|
const promise = new Promise((res, rej) => {
|
||||||
|
resolve = res;
|
||||||
|
reject = rej;
|
||||||
|
});
|
||||||
|
return { promise, resolve, reject };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
require("dotenv").config();
|
require("dotenv").config();
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue