JorrinKievit / tmdb-js

A typesafe API wrapper for the TheMovieDatabase API for Node and the Web
10 stars 1 forks source link

Append to response type issues #24

Closed newmoneybigbucks closed 10 months ago

newmoneybigbucks commented 10 months ago

AppendToResopnseType and ResponseTypeFor had an issue where if there was a key shared among all the append to response types only the types found in MoviesAppendToReponseTypes would be used since ReponseTypeFor had that type first in its set of conditionals. I added some code to add string literals to use as type information/a discriminant so AppendToResponseType type now takes a string literal (the functions that use the type pass the appropriate literal) and passes this to ReponseType which uses it to retrieve the correct set of types instead of just MoviesAppendToResponseTypes

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: 1d10583906dad4bddf371a9e5d8ae630c69fe085

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------ | ----- | | tmdb-js-node | Patch | | tmdb-js-web | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

JorrinKievit commented 10 months ago

Smart! Looks good!