diff --git a/app/pages/search.vue b/app/pages/search.vue index ce503b995b..0928f8d34a 100644 --- a/app/pages/search.vue +++ b/app/pages/search.vue @@ -73,7 +73,7 @@ const { settings } = useSettings() /** * Reorder results to put exact package name match at the top, - * and optionally filter out platform-specific packages. + * and optionally filter out platform-specific packages or security holding packages. */ const visibleResults = computed(() => { const raw = rawVisibleResults.value @@ -81,6 +81,9 @@ const visibleResults = computed(() => { let objects = raw.objects + // Filter out "Security holding package" package takendown by npm registory + objects = objects.filter(r => r.package.repository?.url !== 'npm/security-holder') + // Filter out platform-specific packages if setting is enabled if (settings.value.hidePlatformPackages) { objects = objects.filter(r => !isPlatformSpecificPackage(r.package.name)) diff --git a/shared/types/npm-registry.ts b/shared/types/npm-registry.ts index 250a9218e6..e44b4ac762 100644 --- a/shared/types/npm-registry.ts +++ b/shared/types/npm-registry.ts @@ -187,6 +187,7 @@ export interface NpmSearchPackage { publisher?: NpmSearchPublisher maintainers?: NpmPerson[] license?: string + repository?: NpmSearchRepository } export interface NpmSearchScore { @@ -312,6 +313,20 @@ export interface NpmTrustedPublisher { ciConfigPath?: string } +/** + * Repository types + * Note: Not covered by @npm/types + */ +export interface NpmSearchRepository { + type: 'git' + url: string + project: string + user: string + host: string + path: string + branch: string +} + /** * jsDelivr API Types * Used for package file browsing