Nekos-life / nekos-dot-life

Nekos.life wrapper.
MIT License
166 stars 33 forks source link

Add endpoint types #25

Closed Vendicated closed 2 years ago

Vendicated commented 4 years ago

This adds the new types NekoSfwEndpoints and NekoNsfwEndpoints. This is useful for having dynamic functions within typescript. Here is an example on why this is useful:

getHentai = async (type: NekoNsfwEndpoints) => {
    return (await nekos.nsfw[type]())?.url;
};

This helper function will get an image from any nsfw endpoint and only allow a valid Endpoint as parameter for type. Look at some TS related PR

Vendicated commented 4 years ago

Sorry for the 2 unnecessary commits, I am used to my formatter

Motzumoto commented 2 years ago

Consider closing this as nearly all hentai endpoints are gone.

By nearly all, the only thing that remains is spank, and thats probably getting removed soon too