Fix unnecessary initializer

pull/75/head
MillenniumEarl 2021-03-04 10:53:15 +01:00
parent 4b35ec8760
commit 036e42f31f
1 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ export default class PlatformUser {
constructor() constructor()
constructor(id: number) constructor(id: number)
constructor(id: number = undefined) { this._id = id; } constructor(id?: number) { this._id = id; }
//#region Public methods //#region Public methods
@ -134,10 +134,10 @@ export default class PlatformUser {
this._avatar = $(MEMBER.AVATAR).attr("src"); this._avatar = $(MEMBER.AVATAR).attr("src");
this._followed = $(MEMBER.FOLLOWED).text() === "Unfollow"; this._followed = $(MEMBER.FOLLOWED).text() === "Unfollow";
this._ignored = $(MEMBER.IGNORED).text() === "Unignore"; this._ignored = $(MEMBER.IGNORED).text() === "Unignore";
this._messages = parseInt($(MEMBER.MESSAGES).text()); this._messages = parseInt($(MEMBER.MESSAGES).text(), 10);
this._reactionScore = parseInt($(MEMBER.REACTION_SCORE).text()); this._reactionScore = parseInt($(MEMBER.REACTION_SCORE).text());
this._points = parseInt($(MEMBER.POINTS).text()); this._points = parseInt($(MEMBER.POINTS).text(), 10);
this._ratingsReceived = parseInt($(MEMBER.RATINGS_RECEIVED).text()); this._ratingsReceived = parseInt($(MEMBER.RATINGS_RECEIVED).text(), 10);
// Parse date // Parse date
const joined = $(MEMBER.JOINED)?.attr("datetime"); const joined = $(MEMBER.JOINED)?.attr("datetime");
@ -148,7 +148,7 @@ export default class PlatformUser {
// Parse donation // Parse donation
const donation = $(MEMBER.AMOUNT_DONATED)?.text().replace("$", ""); const donation = $(MEMBER.AMOUNT_DONATED)?.text().replace("$", "");
this._amountDonated = donation ? parseInt(donation) : 0; this._amountDonated = donation ? parseInt(donation, 10) : 0;
} }
} else throw htmlResponse.value; } else throw htmlResponse.value;
} }