Skip to content

Commit c8c3199

Browse files
committed
Remove defaults for blocked, critical, etc
1 parent 6de9bab commit c8c3199

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

src/shadow/npm/arborist-helpers.mts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,7 @@ export async function getAlertsMapFromArborist(
188188
consolidate: false,
189189
nothrow: false,
190190
...options,
191-
filter: toFilterConfig({
192-
// Leave 'actions' unassigned so it can be given a default value in
193-
// subsequent functions where `options` is passed.
194-
// actions: undefined,
195-
blocked: true,
196-
critical: true,
197-
cve: true,
198-
existing: false,
199-
fixable: false,
200-
upgradable: false,
201-
...getOwn(options, 'filter'),
202-
}),
191+
filter: toFilterConfig(getOwn(options, 'filter')),
203192
} as GetAlertsMapFromArboristOptions & { filter: AlertFilter }
204193

205194
const needInfoOn = getDetailsFromDiff(arb.diff, {

src/shadow/npm/arborist/lib/arborist/index.mts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import type {
1414
} from '../../types.mts'
1515

1616
const {
17-
NPM,
1817
NPX,
1918
SOCKET_CLI_ACCEPT_RISKS,
2019
SOCKET_CLI_SAFE_BIN,
@@ -119,7 +118,6 @@ export class SafeArborist extends Arborist {
119118
? undefined
120119
: // Lazily access constants.spinner.
121120
constants.spinner
122-
const isSafeNpm = binName === NPM
123121
const isSafeNpx = binName === NPX
124122
const alertsMap = await getAlertsMapFromArborist(this, {
125123
spinner,
@@ -128,14 +126,10 @@ export class SafeArborist extends Arborist {
128126
? {
129127
actions: ['error'],
130128
blocked: true,
131-
critical: false,
132-
cve: false,
133129
existing: true,
134-
fixable: false,
135130
}
136131
: {
137132
existing: isSafeNpx,
138-
fixable: !isSafeNpm,
139133
},
140134
})
141135
if (alertsMap.size) {

src/utils/alerts-map.mts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,7 @@ export async function getAlertsMapFromPurls(
4949
consolidate: false,
5050
nothrow: false,
5151
...options,
52-
filter: toFilterConfig({
53-
// Leave 'actions' unassigned so it can be given a default value in
54-
// subsequent functions where `options` is passed.
55-
// actions: undefined,
56-
blocked: true,
57-
critical: true,
58-
cve: true,
59-
existing: false,
60-
fixable: false,
61-
upgradable: false,
62-
...getOwn(options, 'filter'),
63-
}),
52+
filter: toFilterConfig(getOwn(options, 'filter')),
6453
} as GetAlertsMapFromPurlsOptions & { filter: AlertFilter }
6554

6655
const uniqPurls = arrayUnique(purls)
@@ -100,7 +89,6 @@ export async function getAlertsMapFromPurls(
10089
queryParams: {
10190
alerts: 'true',
10291
compact: 'true',
103-
//...(opts.filter.fixable ? { fixable: 'true' } : {}),
10492
...(Array.isArray(opts.filter.actions)
10593
? { actions: opts.filter.actions.join(',') }
10694
: {}),

0 commit comments

Comments
 (0)