main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import { PageSignatureError } from "../error";
const responseSymbol = Symbol("response");
const passThroughSymbol = Symbol("passThrough");
export const waitUntilSymbol = Symbol("waitUntil");
class FetchEvent {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(_request){
this[waitUntilSymbol] = [];
this[passThroughSymbol] = false;
}
respondWith(response) {
if (!this[responseSymbol]) {
this[responseSymbol] = Promise.resolve(response);
}
}
passThroughOnException() {
this[passThroughSymbol] = true;
}
waitUntil(promise) {
this[waitUntilSymbol].push(promise);
}
}
export class NextFetchEvent extends FetchEvent {
constructor(params){
super(params.request);
this.sourcePage = params.page;
}
/**
* @deprecated The `request` is now the first parameter and the API is now async.
*
* Read more: https://nextjs.org/docs/messages/middleware-new-signature
*/ get request() {
throw new PageSignatureError({
page: this.sourcePage
});
}
/**
* @deprecated Using `respondWith` is no longer needed.
*
* Read more: https://nextjs.org/docs/messages/middleware-new-signature
*/ respondWith() {
throw new PageSignatureError({
page: this.sourcePage
});
}
}
//# sourceMappingURL=fetch-event.js.map