Skip to content

Commit e4f6eb5

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

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929

3030
- name: Setup Bun
3131
uses: oven-sh/setup-bun@22457c87c1b161cf7dde222c3e82b2b5f8d2bed2
32+
with:
33+
no-cache: true
3234

3335
- name: Install dependencies
3436
run: bun install

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)