Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update V1.2.2 #7

Merged
merged 3 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "genshin-locker",
"private": true,
"productName": "genshin-locker",
"version": "1.2.1",
"version": "1.2.2",
"description": "Genshin artifact scraper and manager",
"main": "packages/main/dist/index.cjs",
"scripts": {
Expand Down
9 changes: 5 additions & 4 deletions packages/automation/src/util/scraper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ export const getSubstats = (txts: string[]): SubStat[] => {
export const getArtifactSet = (txt: string): SetKey => {
const normalizedTxt = txt.toLowerCase().replaceAll(/[^a-z]+/g, '')
const artifactData = datamine.artifacts
if (!(normalizedTxt in artifactData)) {
const artifactEntry = Object.entries(artifactData)
// Some artifact set names span multiple lines and get cut off by the scan
.find(([key]) => key.startsWith(normalizedTxt))
if (!artifactEntry) {
throw Error(`"${normalizedTxt}" not a valid artifact set`)
}
return artifactData[normalizedTxt as keyof typeof artifactData][
'GOOD'
] as SetKey
return stringToEnum(artifactEntry[1]['GOOD'], SetKey)
}
export const getStatKey = (txt: string): string => {
let normalizedTxt = txt.toLowerCase().replaceAll(/[^a-z]+/g, '')
Expand Down
Loading