Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ 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
if (!raw) return raw

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))
Expand Down
15 changes: 15 additions & 0 deletions shared/types/npm-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export interface NpmSearchPackage {
publisher?: NpmSearchPublisher
maintainers?: NpmPerson[]
license?: string
repository?: NpmSearchRepository
}

export interface NpmSearchScore {
Expand Down Expand Up @@ -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
Expand Down
Loading