Skip to content

Commit

Permalink
chore: Fix validateOpts name
Browse files Browse the repository at this point in the history
  • Loading branch information
PartMan7 committed Nov 15, 2024
1 parent 011ed5d commit 7ca9304
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class User {
this._waits = [];
this.alts = new Set();
}
#validateHTML(opts = {}) {
#validateOpts(opts = {}) {
if (typeof opts === 'string') opts = { name: opts };
if (!opts || typeof opts !== 'object') throw new TypeError('Options must be an object');
const fallbackName = this.parent.status.username + Date.now().toString(36);
Expand All @@ -34,15 +34,15 @@ class User {
}
sendHTML(html, _opts = {}) {
if (!html) throw new Error('Missing HTML argument');
const { opts, room } = this.#validateHTML(_opts);
const { opts, room } = this.#validateOpts(_opts);
if (!room) return false;
const formatted = opts.notransform ? html : this.parent.opts.transformHTML(html, opts);
room.send(`/pmuhtml${opts.change ? 'change' : ''} ${this.userid}, ${opts.name}, ${formatted}`);
return formatted;
}
pageHTML(html, _opts = {}) {
if (!html) throw new Error('Missing HTML argument');
const { opts, room } = this.#validateHTML(_opts);
const { opts, room } = this.#validateOpts(_opts);
if (!room) return false;
const formatted = opts.notransform ? html : this.parent.opts.transformHTML(html, opts);
room.send(`/sendhtmlpage ${this.userid}, ${opts.name}, ${formatted}`);
Expand Down

0 comments on commit 7ca9304

Please sign in to comment.