mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
change build system to rollup
This commit is contained in:
parent
5122438c96
commit
c3db610837
39 changed files with 2225 additions and 2451 deletions
|
@ -1,35 +1,35 @@
|
|||
// ts throws an error if you dont do window.fetch
|
||||
|
||||
import { encodeUrl, rewriteHeaders } from "../../bundle";
|
||||
|
||||
window.fetch = new Proxy(window.fetch, {
|
||||
apply(target, thisArg, argArray) {
|
||||
argArray[0] = encodeUrl(argArray[0]);
|
||||
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
},
|
||||
});
|
||||
|
||||
Headers = new Proxy(Headers, {
|
||||
construct(target, argArray, newTarget) {
|
||||
argArray[0] = rewriteHeaders(argArray[0]);
|
||||
|
||||
return Reflect.construct(target, argArray, newTarget);
|
||||
},
|
||||
})
|
||||
|
||||
Request = new Proxy(Request, {
|
||||
construct(target, argArray, newTarget) {
|
||||
if (typeof argArray[0] === "string") argArray[0] = encodeUrl(argArray[0]);
|
||||
|
||||
return Reflect.construct(target, argArray, newTarget);
|
||||
},
|
||||
});
|
||||
|
||||
Response.redirect = new Proxy(Response.redirect, {
|
||||
apply(target, thisArg, argArray) {
|
||||
argArray[0] = encodeUrl(argArray[0]);
|
||||
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
},
|
||||
// ts throws an error if you dont do window.fetch
|
||||
|
||||
import { encodeUrl, rewriteHeaders } from "../../bundle";
|
||||
|
||||
window.fetch = new Proxy(window.fetch, {
|
||||
apply(target, thisArg, argArray) {
|
||||
argArray[0] = encodeUrl(argArray[0]);
|
||||
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
},
|
||||
});
|
||||
|
||||
Headers = new Proxy(Headers, {
|
||||
construct(target, argArray, newTarget) {
|
||||
argArray[0] = rewriteHeaders(argArray[0]);
|
||||
|
||||
return Reflect.construct(target, argArray, newTarget);
|
||||
},
|
||||
})
|
||||
|
||||
Request = new Proxy(Request, {
|
||||
construct(target, argArray, newTarget) {
|
||||
if (typeof argArray[0] === "string") argArray[0] = encodeUrl(argArray[0]);
|
||||
|
||||
return Reflect.construct(target, argArray, newTarget);
|
||||
},
|
||||
});
|
||||
|
||||
Response.redirect = new Proxy(Response.redirect, {
|
||||
apply(target, thisArg, argArray) {
|
||||
argArray[0] = encodeUrl(argArray[0]);
|
||||
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue