Initial boiler plate project
This commit is contained in:
70
node_modules/next/dist/server/web/spec-extension/fetch-event.js
generated
vendored
Normal file
70
node_modules/next/dist/server/web/spec-extension/fetch-event.js
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
NextFetchEvent: null,
|
||||
waitUntilSymbol: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
NextFetchEvent: function() {
|
||||
return NextFetchEvent;
|
||||
},
|
||||
waitUntilSymbol: function() {
|
||||
return waitUntilSymbol;
|
||||
}
|
||||
});
|
||||
const _error = require("../error");
|
||||
const responseSymbol = Symbol("response");
|
||||
const passThroughSymbol = Symbol("passThrough");
|
||||
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);
|
||||
}
|
||||
}
|
||||
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 _error.PageSignatureError({
|
||||
page: this.sourcePage
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @deprecated Using `respondWith` is no longer needed.
|
||||
*
|
||||
* Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
||||
*/ respondWith() {
|
||||
throw new _error.PageSignatureError({
|
||||
page: this.sourcePage
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fetch-event.js.map
|
||||
Reference in New Issue
Block a user