Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
wearrrrr committed Oct 17, 2024
1 parent 260c78d commit e5a0843
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client/dom/attr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function (client: ScramjetClient, self: typeof window) {

if (value instanceof Attr) {
let attr = value;

return new Proxy(attr, {
get(target, prop) {
if (
Expand All @@ -45,6 +46,7 @@ export default function (client: ScramjetClient, self: typeof window) {
// we're using the proxied getAttribute here
return target.ownerElement.getAttribute(target.name);
}

return Reflect.get(target, prop);
},
set(target, prop, value) {
Expand All @@ -54,8 +56,10 @@ export default function (client: ScramjetClient, self: typeof window) {
prop === "textContent"
) {
target.ownerElement.setAttribute(target.name, value);

return true;
}

return Reflect.set(target, prop, value);
},
});
Expand Down

0 comments on commit e5a0843

Please sign in to comment.