Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nyairobi committed Aug 19, 2024
1 parent 71e894a commit de93dff
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/src/utils/queries/songs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function FindSongOnTitleInsensitive(
// @optimisable: Performance should be tested here by having a utility field for all-titles.

const regexTitle = new RegExp(`^${EscapeStringRegexp(title)}$`, "iu");
const regexArtist = new RegExp(`^${EscapeStringRegexp(artist ?? '')}$`, "iu");
const regexArtist = new RegExp(`^${EscapeStringRegexp(artist ?? "")}$`, "iu");

const res = await db.anySongs[game].find(
{
Expand All @@ -71,10 +71,12 @@ export async function FindSongOnTitleInsensitive(
},
],
},
artist ? {
artist: { $regex: regexArtist }
} : {}
]
artist
? {
artist: { $regex: regexArtist },
}
: {},
],
},
{
limit: 2,
Expand Down

0 comments on commit de93dff

Please sign in to comment.