-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
105 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import ParsedEcon from "../ParsedEcon"; | ||
import ParsedEcon from '../ParsedEcon'; | ||
|
||
export default function getCrateNumber(econ: ParsedEcon): number { | ||
if (!econ.options.retrieveCrateNumber) return 0; | ||
if (econ.nameAttrs.itemNumber || econ.descriptions.itemNumber) return 0; | ||
|
||
const search = econ.options.useTrueDefindex ? econ.trueDefindex : econ.name; | ||
if (!econ.options.retrieveCrateNumber) return 0; | ||
if (econ.nameAttrs.itemNumber || econ.descriptions.itemNumber) return 0; | ||
|
||
return econ.schema.getCrateNumber(search); | ||
const search = econ.options.useTrueDefindex ? econ.trueDefindex : econ.name; | ||
|
||
return econ.schema.getCrateNumber(search); | ||
} |
15 changes: 9 additions & 6 deletions
15
src/parseEconItem/ParsedEcon/getDescriptions/item-number.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import { EconDescription } from "../../../types"; | ||
import { EconDescription } from '../../../types'; | ||
|
||
export function isMedal(description: EconDescription): boolean { | ||
return description.value.startsWith('Medal no. '); | ||
return description.value.startsWith('Medal no. '); | ||
} | ||
|
||
export function isCrate(description: EconDescription): boolean { | ||
return description.value.startsWith('Crate Series ') && description.color === '7ea9d1'; | ||
return ( | ||
description.value.startsWith('Crate Series ') && | ||
description.color === '7ea9d1' | ||
); | ||
} | ||
|
||
export function getMedal(description: EconDescription): number { | ||
return parseInt(description.value.replace('Medal no. ', '')); | ||
return parseInt(description.value.replace('Medal no. ', '')); | ||
} | ||
|
||
export function getCrate(description: EconDescription): number { | ||
return parseInt(description.value.replace('Crate Series #', '')); | ||
} | ||
return parseInt(description.value.replace('Crate Series #', '')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import ParsedEcon from '../ParsedEcon'; | ||
|
||
export default function getUses(econ: ParsedEcon): number { | ||
if (!econ.item?.app_data?.quantity) { | ||
return 0; | ||
} | ||
if (!econ.item?.app_data?.quantity) { | ||
return 0; | ||
} | ||
|
||
const uses = parseInt(econ.item?.app_data?.quantity); | ||
return isNaN(uses) ? 0 : uses; | ||
return isNaN(uses) ? 0 : uses; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export default function (name: string): boolean { | ||
return name.includes('Festivized ') && !name.includes('Festivized Formation'); | ||
return ( | ||
name.includes('Festivized ') && !name.includes('Festivized Formation') | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.