fixed lint/suspicious/noGlobalIsNan
This commit is contained in:
parent
5b46e956c4
commit
133c0f760d
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user