theBowja / genshin-db

npm package with searching functions for Genshin Impact data of all in-game languages. Data parsed/organized directly from GenshinData repo.
MIT License
370 stars 68 forks source link

Unable to get the artifact set-bonuses data. #31

Closed Another19-archived closed 3 years ago

Another19-archived commented 3 years ago
    "name": "any artifact name here",
    "rarity": [
        "1",
        "2",
        "3"
    ],
    "2pc": "Max HP increased by 1000.",
    "4pc": "Opening a chest regenerates 30% Max HP over 5s.",
    ... and more stuff below etc.

<genshin-db>.artifacts('any artifact name here').2pc and .4pc will return SyntaxError: Invalid or unexpected token

Variable Error: You can NOT set variable name that has number/integer at their first letter. Can you maybe by replacing 2pc and 4pc to something like two-bonus and fullset-bonus, or would you like me to fix the data for you by contributing?

theBowja commented 3 years ago

You can access the .2pc/4pc property using bracket notation.

For example artifact["2pc"].

I will consider changing the property name in the future.

Thanks

Another19-archived commented 3 years ago

Oh, i didnt know that exists. Alright you made by day. Much thanks.