fixed lint/suspicious/noGlobalIsNan

This commit is contained in:
TheSparta 2023-10-31 22:54:59 +00:00
parent 5b46e956c4
commit 133c0f760d
4 changed files with 5 additions and 5 deletions

View File

@ -854,7 +854,7 @@ class ItemHelper
*/
public isAttachmentAttached(item: Item): boolean
{
return item.slotId !== "hideout" && item.slotId !== "main" && isNaN(Number(item.slotId));
return item.slotId !== "hideout" && item.slotId !== "main" && Number.isNaN(Number(item.slotId));
}
/**

View File

@ -297,7 +297,7 @@ export class RagfairOfferHelper
public increaseProfileRagfairRating(profile: IAkiProfile, amountToIncrementBy: number): void
{
profile.characters.pmc.RagfairInfo.isRatingGrowing = true;
if (isNaN(amountToIncrementBy))
if (Number.isNaN(amountToIncrementBy))
{
this.logger.warning(`Unable to increment ragfair rating, value was not a number: ${amountToIncrementBy}`);
@ -595,7 +595,7 @@ export class RagfairOfferHelper
return false;
}
if (isNaN(offer.requirementsCost))
if (Number.isNaN(offer.requirementsCost))
{
// don't include offers with null or NaN in it
return false;

View File

@ -77,7 +77,7 @@ export class RagfairSellHelper
const result: SellResult[] = [];
// Value can sometimes be NaN for whatever reason, default to base chance if that happens
if (isNaN(sellChancePercent))
if (Number.isNaN(sellChancePercent))
{
this.logger.warning(`Sell chance was not a number: ${sellChancePercent}, defaulting to ${this.ragfairConfig.sell.chance.base} %`);
sellChancePercent = this.ragfairConfig.sell.chance.base;

View File

@ -970,7 +970,7 @@ export class ProfileFixerService
public fixIncorrectAidValue(fullProfile: IAkiProfile): void
{
// Not a number, regenerate
if (isNaN(fullProfile.characters.pmc.aid))
if (Number.isNaN(fullProfile.characters.pmc.aid))
{
fullProfile.characters.pmc.sessionId = <string><unknown>fullProfile.characters.pmc.aid;
fullProfile.characters.pmc.aid = this.hashUtil.generateAccountId();