Skip to content

Commit e6d0e1d

Browse files
committed
move the logic upstream
1 parent 3db77e2 commit e6d0e1d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/composables/useNpmRegistry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ export function useNpmSearch(
239239
let lastSearch: NpmSearchResponse | undefined = undefined
240240

241241
return useLazyAsyncData(
242-
() => `search:${toValue(query)}:${JSON.stringify(toValue(options))}`,
242+
() => `search:${toValue(query).trim().toLowerCase()}:${JSON.stringify(toValue(options))}`,
243243
async () => {
244-
const q = toValue(query)
245-
if (!q.trim()) {
244+
const q = toValue(query).trim().toLowerCase()
245+
if (!q) {
246246
return Promise.resolve(emptySearchResponse)
247247
}
248248

249249
const params = new URLSearchParams()
250-
params.set('text', q.toLowerCase())
250+
params.set('text', q)
251251
const opts = toValue(options)
252252
if (opts.size) params.set('size', String(opts.size))
253253
if (opts.from) params.set('from', String(opts.from))

0 commit comments

Comments
 (0)