mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
prettier
This commit is contained in:
parent
fa779017ad
commit
d6dd1d4ca3
20 changed files with 363 additions and 379 deletions
|
@ -11,24 +11,27 @@ function createLocation() {
|
|||
return loc;
|
||||
}
|
||||
|
||||
export const locationProxy = new Proxy({
|
||||
host: ""
|
||||
}, {
|
||||
get(target, prop) {
|
||||
const loc = createLocation();
|
||||
|
||||
return loc[prop];
|
||||
export const locationProxy = new Proxy(
|
||||
{
|
||||
host: "",
|
||||
},
|
||||
{
|
||||
get(target, prop) {
|
||||
const loc = createLocation();
|
||||
|
||||
set(obj, prop, value) {
|
||||
const loc = createLocation();
|
||||
return loc[prop];
|
||||
},
|
||||
|
||||
if (prop === "href") {
|
||||
location.href = encodeUrl(value);
|
||||
} else {
|
||||
loc[prop] = value;
|
||||
}
|
||||
set(obj, prop, value) {
|
||||
const loc = createLocation();
|
||||
|
||||
return true;
|
||||
},
|
||||
});
|
||||
if (prop === "href") {
|
||||
location.href = encodeUrl(value);
|
||||
} else {
|
||||
loc[prop] = value;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue