nextjs-server-modules
Advanced tools
Comparing version 1.5.16 to 1.5.17-seve.0
@@ -89,3 +89,3 @@ // Modified version of: https://github.com/vercel/next.js/blob/e8408c70863b6bcd05437ff92a19194788716722/packages/next/server/api-utils.ts | ||
} | ||
apiRes.end = (...args: any[2]) => { | ||
;(apiRes as any).end = (...args: any[2]) => { | ||
if (args.length && typeof args[0] !== "function") { | ||
@@ -92,0 +92,0 @@ contentLength += Buffer.byteLength(args[0] || "") |
@@ -5,2 +5,3 @@ const glob = require("glob-promise") | ||
const prettier = require("prettier") | ||
const { existsSync } = require("fs") | ||
const fs = require("fs/promises") | ||
@@ -28,5 +29,5 @@ | ||
for (const fp of staticFiles) { | ||
const fileContentB64 = (await fs.readFile(path.resolve(nextDir, fp))).toString( | ||
"base64" | ||
) | ||
const fileContentB64 = ( | ||
await fs.readFile(path.resolve(nextDir, fp)) | ||
).toString("base64") | ||
const outFilePath = path.resolve( | ||
@@ -40,6 +41,11 @@ __dirname, | ||
// Fixes race condition on MAC | ||
await new Promise(resolve => setTimeout(resolve, 10)) | ||
await new Promise((resolve) => setTimeout(resolve, 10)) | ||
await fs.writeFile(outFilePath, outFileContent) | ||
} | ||
let pagesDirRelativePath = ".." | ||
if (existsSync(__dirname, "../src/pages")) { | ||
pagesDirRelativePath = "../src" | ||
} | ||
const routesFile = prettier.format( | ||
@@ -51,3 +57,6 @@ `import serveStatic from "./serve-static" | ||
fp.startsWith("pages/api") | ||
? `"${route}": require("../${fp.split(".").slice(0, -1).join(".")}")` | ||
? `"${route}": require("${pagesDirRelativePath}/${fp | ||
.split(".") | ||
.slice(0, -1) | ||
.join(".")}")` | ||
: `"${route}": serveStatic("${ | ||
@@ -54,0 +63,0 @@ fp.split(".").slice(-1)[0] |
{ | ||
"name": "nextjs-server-modules", | ||
"version": "1.5.16", | ||
"version": "1.5.17-seve.0", | ||
"main": "bin.js", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:hello-seam/nextjs-server-modules.git", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
115195
41
3207
2
26