add way to get rid of document in Works and Chapters
ci/woodpecker/push/woodpecker Pipeline failed Details

master
Drake 1 year ago
parent 6c932711b3
commit bec8c41eb8

@ -86,6 +86,12 @@ export default class Chapter {
await this.populateText();
}
// deletes our #document if we want to clean up memory and not use a shitton
freeDocument() {
//completely sane behaviour
this.#document = undefined as unknown as HTMLDocument;
}
populateMetadata() {
this.#name = this.#document.querySelector("h3.title")?.innerText
.replace(

@ -63,6 +63,12 @@ export default class Work {
await this.populateChapters();
}
// deletes our #document if we want to clean up memory and not use a shitton
freeDocument() {
//completely sane behaviour
this.#document = undefined as unknown as HTMLDocument;
}
populateMetadata() {
this.name = (this.#document.querySelector("h2.title") as Element)
.innerText.trim();

Loading…
Cancel
Save