feat: scaffold Astro + Tailwind project

This commit is contained in:
TerryM
2026-05-12 16:16:03 +08:00
parent 906eb5c763
commit 03d3800c6c
12097 changed files with 1266600 additions and 0 deletions

43
node_modules/astro/dist/core/request-body.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
async function readBodyWithLimit(request, limit) {
const contentLengthHeader = request.headers.get("content-length");
if (contentLengthHeader) {
const contentLength = Number.parseInt(contentLengthHeader, 10);
if (Number.isFinite(contentLength) && contentLength > limit) {
throw new BodySizeLimitError(limit);
}
}
if (!request.body) return new Uint8Array();
const reader = request.body.getReader();
const chunks = [];
let received = 0;
while (true) {
const { done, value } = await reader.read();
if (done) break;
if (value) {
received += value.byteLength;
if (received > limit) {
throw new BodySizeLimitError(limit);
}
chunks.push(value);
}
}
const buffer = new Uint8Array(received);
let offset = 0;
for (const chunk of chunks) {
buffer.set(chunk, offset);
offset += chunk.byteLength;
}
return buffer;
}
class BodySizeLimitError extends Error {
limit;
constructor(limit) {
super(`Request body exceeds the configured limit of ${limit} bytes`);
this.name = "BodySizeLimitError";
this.limit = limit;
}
}
export {
BodySizeLimitError,
readBodyWithLimit
};