Skip to content

Commit 3840fdd

Browse files
committed
fix: missing prop from purl endpoint
1 parent 02f1345 commit 3840fdd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ export const scanner: Bun.Security.Scanner = {
6262
for (const alert of artifact.alerts) {
6363
const description = ['']
6464

65-
if (alert.type === 'didYouMean') {
65+
if (alert.type === 'didYouMean' && alert.props?.alternatePackage) {
6666
description.push(`This package could be a typo-squatting attempt of another package (${alert.props.alternatePackage}).`)
6767
}
6868

69-
if (alert.props.description) {
69+
if (alert.props?.description) {
7070
description.push(alert.props.description)
7171
}
7272

73-
if (alert.props.note) {
73+
if (alert.props?.note) {
7474
description.push(alert.props.note)
7575
}
7676

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type SocketArtifact = {
55
alerts: {
66
action: 'error' | 'warn'
77
type: string,
8-
props: {
8+
props?: {
99
note?: string,
1010
didYouMean?: string,
1111
} & Record<string, any>

0 commit comments

Comments
 (0)