Skip to content

Commit

Permalink
fix: remove whitespaces from type literals (#94)
Browse files Browse the repository at this point in the history
* fix literal types

* fix tests
  • Loading branch information
eegli authored Oct 19, 2024
1 parent 93f934c commit 5bde726
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-flies-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spotifly/core": patch
---

Fix literal type params
6 changes: 3 additions & 3 deletions packages/core/src/models/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export type PlaybackShuffle = boolean & _;
export type Base64URL = string & _;

export type Params = {
additional_types: LiteralUnion<'track' | ' episode'>[];
additional_types: LiteralUnion<'track' | 'episode'>[];
after: string;
collaborative: boolean;
context_uri: string;
Expand All @@ -111,7 +111,7 @@ export type Params = {
fields: string;
include_external: 'audio';
include_groups: LiteralUnion<
'album' | ' single' | ' appears_on' | ' compilation'
'album' | 'single' | 'appears_on' | 'compilation'
>[];
insert_before: number;
limit: number;
Expand All @@ -126,7 +126,7 @@ export type Params = {
range_length: number;
range_start: number;
snapshot_id: string;
time_range: 'long_term ' | 'medium_term' | 'short_term';
time_range: 'long_term' | 'medium_term' | 'short_term';
timestamp: string;
uris: Uri[];
};
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/__snapshots__/lib.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ exports[`Users getUsersTopArtists 1`] = `
"params": {
"limit": 1,
"offset": 1,
"time_range": "long_term ",
"time_range": "long_term",
},
"url": "me/top/artists",
},
Expand All @@ -1422,7 +1422,7 @@ exports[`Users getUsersTopTracks 1`] = `
"params": {
"limit": 1,
"offset": 1,
"time_range": "long_term ",
"time_range": "long_term",
},
"url": "me/top/tracks",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/lib.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ const tests: LibTestRunner = [
Client.Users.getUsersTopArtists({
limit,
offset,
time_range: 'long_term ',
time_range: 'long_term',
}),
),
},
Expand All @@ -377,7 +377,7 @@ const tests: LibTestRunner = [
Client.Users.getUsersTopTracks({
limit,
offset,
time_range: 'long_term ',
time_range: 'long_term',
}),
),
},
Expand Down

0 comments on commit 5bde726

Please sign in to comment.