-
-
Notifications
You must be signed in to change notification settings - Fork 5
Typechecking fixes #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
3fa1910
c332eb5
71f73f1
57c969c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,10 +22,10 @@ export class GithubStrategy extends PassportStrategy(strategy, 'github') { | |
| super({ | ||
| clientID: GITHUB_CLIENT_ID, | ||
| clientSecret: GITHUB_CLIENT_SECRET, | ||
| redirect_uri: `${SERVER_URL}/v1/auth/github/callback`, | ||
| callbackURL: `${SERVER_URL}/v1/auth/github/callback`, | ||
| scope: 'user:read,user:email', | ||
| state: false, | ||
| }); | ||
| } as any); | ||
|
Comment on lines
22
to
+28
|
||
| } | ||
|
|
||
| async validate(accessToken: string, refreshToken: string, profile: any) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -132,7 +132,9 @@ export class SongController { | |||||||||
| [SongSortType.NOTE_COUNT, 'stats.noteCount'], | ||||||||||
| ]); | ||||||||||
|
|
||||||||||
| const sortField = sortFieldMap.get(query.sort) ?? 'createdAt'; | ||||||||||
| const sortField = query.sort | ||||||||||
| ? sortFieldMap.get(query.sort) ?? 'createdAt' | ||||||||||
| : 'createdAt'; | ||||||||||
|
Comment on lines
+135
to
+137
|
||||||||||
| const sortField = query.sort | |
| ? sortFieldMap.get(query.sort) ?? 'createdAt' | |
| : 'createdAt'; | |
| const sortField = sortFieldMap.get(query.sort) ?? 'createdAt'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1225,8 +1225,7 @@ describe('SongService', () => { | |
| exec: jest.fn().mockResolvedValue(songList), | ||
| }; | ||
|
|
||
| mockSongModel.aggregate.mockReturnValue(mockAggregate as any); | ||
| mockSongModel.populate.mockResolvedValue(songList); | ||
| jest.spyOn(songModel, 'aggregate').mockReturnValue(mockAggregate as any); | ||
|
||
|
|
||
| const result = await service.getRandomSongs(count); | ||
|
|
||
|
|
@@ -1253,8 +1252,7 @@ describe('SongService', () => { | |
| exec: jest.fn().mockResolvedValue(songList), | ||
| }; | ||
|
|
||
| mockSongModel.aggregate.mockReturnValue(mockAggregate as any); | ||
| mockSongModel.populate.mockResolvedValue(songList); | ||
| jest.spyOn(songModel, 'aggregate').mockReturnValue(mockAggregate as any); | ||
|
||
|
|
||
| const result = await service.getRandomSongs(count, category); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| declare module '@nbw/thumbnail/node' { | ||
| interface DrawParams { | ||
| notes: unknown; | ||
| startTick: number; | ||
| startLayer: number; | ||
| zoomLevel: number; | ||
| backgroundColor: string; | ||
| imgWidth: number; | ||
| imgHeight: number; | ||
| } | ||
|
|
||
| export function drawToImage(params: DrawParams): Promise<Buffer>; | ||
| export function drawNotesOffscreen(params: DrawParams): Promise<unknown>; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cast
payload as objectis unnecessary sinceTokenPayloadis already an object type with defined properties. This cast reduces type safety without providing benefit. Similarly, casting the options object toanymasks potential type issues with the JWT service configuration. Consider reviewing the JWT service types to ensure proper type compatibility rather than using type assertions.