Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
61 stars 22 forks source link

enforce type #52

Closed EvilG-MC closed 2 months ago

EvilG-MC commented 2 months ago

The getPlayer method always returns the Player type, even though it may be undefined the solution is to force the type to make sure in case of typescript users it is Player | undefined.

Tomato6966 commented 2 months ago

There is literally no type change

map.get() is on default returns: Value | undefined In this case: players.get() returns: Player | undefined image

Tomato6966 commented 2 months ago

There is no need of enforcing, that's what i mean

EvilG-MC commented 2 months ago

Well...

image

EvilG-MC commented 2 months ago

If I go to the type definition:

image

Tomato6966 commented 2 months ago

ok

EvilG-MC commented 2 months ago

That's why I enforce the type

Tomato6966 commented 2 months ago

I have added more "enforcements", will add more in the future, then somewhen merge it

Will do it for EVERY function.

Tomato6966 commented 2 months ago

Thanks

EvilG-MC commented 2 months ago

Sounds good to me! Thanks

Tomato6966 commented 2 months ago

I merged it, and will add more type enforcements with the v2.4.x release, thanks