Merge branch 'fix/examples-node'

This commit is contained in:
Alexander Cerutti
2025-05-28 22:08:49 +02:00
6 changed files with 95 additions and 103 deletions

View File

@@ -5,7 +5,7 @@
"jsx": "react",
"module": "Node16",
"moduleResolution": "Node16",
"types": ["@cloudflare/workers-types"],
"types": ["@cloudflare/workers-types", "node"],
"resolveJsonModule": true,
"allowJs": true,
"checkJs": false,

View File

@@ -24,6 +24,7 @@
"@types/express": "5.0.0",
"@types/express-serve-static-core": "^5.0.4",
"tsx": "^4.19.2",
"typescript": "^5.7.3"
"typescript": "^5.7.3",
"@types/node": "^20.0.0"
}
}

View File

@@ -32,11 +32,11 @@ export function removeHidden(from: Array<string>): Array<string> {
async function readFileOrDirectory(filePath: string) {
if ((await fs.lstat(filePath)).isDirectory()) {
return Promise.all(await readDirectory(filePath));
} else {
return fs
.readFile(filePath)
.then((content) => getObjectFromModelFile(filePath, content, 1));
}
const fileBuffer = await fs.readFile(filePath);
return getObjectFromModelFile(filePath, fileBuffer, 1);
}
/**

View File

@@ -26,7 +26,7 @@ app.route("/scratch/:modelName").get(async (request, response) => {
"../../models/exampleBooking.pass/icon.png",
),
),
await getCertificates(),
getCertificates(),
]);
try {

View File

@@ -22,6 +22,6 @@
"serverless-plugin-typescript": "^2.1.5",
"serverless-s3-local": "^0.8.5",
"typescript": "^5.7.3",
"@types/node": "^18"
"@types/node": "^20"
}
}