Sansossio / twisted

Fetching riot games api data
122 stars 45 forks source link

Typo in class ChampionsDataDragonDetailsSolo #38

Closed kalempster closed 3 years ago

kalempster commented 3 years ago

Hello, I've found a typo that leads to being unable to access spells. In the ChampionsDataDragonDetailsSolo class, there is a speels object while the api returns a spells object leading to speels being undefined.

export declare class ChampionsDataDragonDetailsSolo extends ChampionsDataDragonDetails {
    lore: string;
    skins: {
        id: string;
        num: number;
        name: string;
        chromas: boolean;
    }[];
    allytips: string[];
    enemytips: string[];
    speels: {
        id: string;
        name: string;
        description: string;
        tooltip: string;
        leveltip: {
            label: string[];
            effect: string[];
        };

When getting intelisense it only shows the speels property and when you type in spells it shows it as an error "Property 'spells' does not exist on type 'ChampionsDataDragonDetailsSolo'. Did you mean 'speels'?"

const data = await new twisted.LolApi().DataDragon.getChampion(twisted.Constants.Champions.MISS_FORTUNE);
        console.log(data.speels); //undefined
        console.log(data.spells); // [{id: id: 'MissFortuneRicochetShot', name: 'Double Up' ...
Sansossio commented 3 years ago

Can you fix it?

kalempster commented 3 years ago

Can you fix it?

Well, you only need to change the name of the property from speels to spells. Nothing much but definitely makes the expirence better

Sansossio commented 3 years ago

Yes, I know what I need to do, but you could also do it ;) here is the fix: https://github.com/Sansossio/twisted/commit/c403dcc5ff4a5f5899e7fcd9dbc20c8b01bb5b2f

version 1.41.0 already published