From 6f275d191622c444cb098538c933eb859bd3433e Mon Sep 17 00:00:00 2001 From: patrick-motard Date: Sun, 7 Feb 2021 01:43:49 -0600 Subject: [PATCH] fix: fixes incomplete type for player api function `getCurrentlyPlayingTrack` returns an empty string if no song is currently playing. The type response of that function is incorrect, leading to complile errors. This PR fixes the issue by correcting the type response. Fixes #22 --- .gitignore | 4 ++++ src/apis/PlayerApi.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b69a7c2..231e693 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# This project uses yarn. Do not +# include npm package lock. +package-lock.json + # Logs logs *.log diff --git a/src/apis/PlayerApi.ts b/src/apis/PlayerApi.ts index 6d3c9b8..f013283 100644 --- a/src/apis/PlayerApi.ts +++ b/src/apis/PlayerApi.ts @@ -48,7 +48,7 @@ export class PlayerApi { */ getCurrentlyPlayingTrack( options?: GetCurrentlyPlayingTrackOptions, - ): Promise { + ): Promise { return this.http.get( '/me/player/currently-playing', options && { params: options },