Skip to content

Conversation

@iamrgroot
Copy link

@iamrgroot iamrgroot commented Jun 20, 2024

BREAKING CHANGE: This changes the return type of all endpoints during development, as they can now return undefined in Typescript land

Summary

The makeRequest function in the SpotifyApi class has a return type of Promise<TReturnType>, but it can and will return Promise<null> in some cases

Changes

This can cause exceptions when using the SDK. So this PR fixes this to use the actual type Promise<TReturnType|null>, so these errors can be caught during the type check in development.

Results

No actual changes in behaviour, just in the Typescript types

changed all incorrect casting using as with the actual return types

BREAKING CHANGE: This changes all endpoints during development, as they can now return undefined in
Typescript land
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant