We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5ae776 commit c0a11fdCopy full SHA for c0a11fd
1 file changed
app/composables/useNpmRegistry.ts
@@ -382,9 +382,11 @@ export function useNpmSearch(
382
383
// Update cache
384
if (cache.value && cache.value.query === q) {
385
+ const existingNames = new Set(cache.value.objects.map(obj => obj.package.name))
386
+ const newObjects = response.objects.filter(obj => !existingNames.has(obj.package.name))
387
cache.value = {
388
query: q,
- objects: [...cache.value.objects, ...response.objects],
389
+ objects: [...cache.value.objects, ...newObjects],
390
total: response.total,
391
}
392
} else {
0 commit comments