You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thank you for creating a great package. However, while using it, I noticed I couldn't narrow down the object types using standard TS type guards. For example, given an item: Track | Episode; I can't narrow it down to Track by simply checking item.type === "episode".
This happens because all interfaces share the same SpotifyType, which doesn't guarantee an Episode will always have a "episode" as a type.
Could we change them to simple literal types to benefit from type narrowing? I'd like to file a PR if you're interested.
The text was updated successfully, but these errors were encountered:
Hi! Thank you for creating a great package. However, while using it, I noticed I couldn't narrow down the object types using standard TS type guards. For example, given an
item: Track | Episode;
I can't narrow it down toTrack
by simply checkingitem.type === "episode"
.This happens because all interfaces share the same
SpotifyType
, which doesn't guarantee anEpisode
will always have a"episode"
as a type.Could we change them to simple literal types to benefit from type narrowing? I'd like to file a PR if you're interested.
The text was updated successfully, but these errors were encountered: