Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
wont-stream authored Nov 8, 2024
1 parent cd9cf96 commit 899ca51
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions plugins/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ const optimize = orig => function(...args) {
return orig.apply(this, args);
};

let remove, removeChild, append, appendChild;
let removeChild, append, appendChild;

export function onLoad() {
remove = Element.prototype.remove;
removeChild = Element.prototype.removeChild;
append = Element.prototype.append;
appendChild = Element.prototype.appendChild;

Element.prototype.remove = optimize(Element.prototype.remove);
Element.prototype.removeChild = optimize(Element.prototype.removeChild);
Element.prototype.append = optimize(Element.prototype.append);
Element.prototype.appendChild = optimize(Element.prototype.appendChild);
}

export function onUnload() {
Element.prototype.remove = remove;
Element.prototype.removeChild = removeChild;
Element.prototype.append = append;
Element.prototype.appendChild = appendChild;
Expand Down

0 comments on commit 899ca51

Please sign in to comment.