Initial boiler plate project
This commit is contained in:
26
node_modules/next/dist/experimental/testmode/httpget.js
generated
vendored
Normal file
26
node_modules/next/dist/experimental/testmode/httpget.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "interceptHttpGet", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return interceptHttpGet;
|
||||
}
|
||||
});
|
||||
const _ClientRequest = require("next/dist/compiled/@mswjs/interceptors/ClientRequest");
|
||||
const _fetch = require("./fetch");
|
||||
function interceptHttpGet(originalFetch) {
|
||||
const clientRequestInterceptor = new _ClientRequest.ClientRequestInterceptor();
|
||||
clientRequestInterceptor.on("request", async ({ request })=>{
|
||||
const response = await (0, _fetch.handleFetch)(originalFetch, request);
|
||||
request.respondWith(response);
|
||||
});
|
||||
clientRequestInterceptor.apply();
|
||||
// Cleanup.
|
||||
return ()=>{
|
||||
clientRequestInterceptor.dispose();
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=httpget.js.map
|
||||
Reference in New Issue
Block a user