Skip to content

Commit c1d8e98

Browse files
committed
Minor code cleanup
1 parent afd130b commit c1d8e98

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/commands/scan/cmd-scan-create.mts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ async function run(
294294
let updatedInput = false
295295

296296
if (!targets.length && !dryRun && interactive) {
297-
const received = await suggestTarget()
298-
targets = received ?? []
297+
targets = await suggestTarget()
299298
updatedInput = true
300299
}
301300

src/commands/scan/generate-report.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function createLeaf(
239239
type: alert.type,
240240
policy: policyAction,
241241
url: getSocketDevPackageOverviewUrlFromPurl(art),
242-
manifest: art.manifestFiles?.map(obj => obj.file) ?? [],
242+
manifest: art.manifestFiles?.map(o => o.file) ?? [],
243243
}
244244
return leaf
245245
}

src/commands/scan/suggest_target.mts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { select } from '@socketsecurity/registry/lib/prompts'
22

3-
export async function suggestTarget(): Promise<string[] | void> {
3+
export async function suggestTarget(): Promise<string[]> {
44
// We could prefill this with sub-dirs of the current
55
// dir ... but is that going to be useful?
66
const proceed = await select<boolean>({
@@ -19,7 +19,5 @@ export async function suggestTarget(): Promise<string[] | void> {
1919
},
2020
],
2121
})
22-
if (proceed) {
23-
return ['.']
24-
}
22+
return proceed ? ['.'] : []
2523
}

0 commit comments

Comments
 (0)