Skip to content

Commit 665547b

Browse files
101arrowzbmeck
andauthored
Apply suggestions from code review
Co-authored-by: Bradley Farias <[email protected]> Signed-off-by: 101arrowz <[email protected]>
1 parent 52f1457 commit 665547b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/commands/login/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const login = {
115115
enforcedOrgs = [enforcedChoices[0]?.value]
116116
}
117117
}
118+
// MUST DO all updateSetting ON SAME TICK TO AVOID PARTIAL WRITE
118119
updateSetting('enforcedOrgs', enforcedOrgs)
119120
const oldKey = getSetting('apiKey')
120121
updateSetting('apiKey', apiKey)

lib/shadow/npm-injection.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ async function packagesHaveRiskyIssues (registry, pkgs, ora = null, input, outpu
493493
}
494494
for (const issue of (pkgData.value?.issues ?? [])) {
495495
if (rules[issue.type]) {
496-
if (typeof rules[issue.type] == 'boolean' || rules[issue.type].action === 'error') {
496+
if ((typeof rules[issue.type] == 'boolean' && rules[issue.type]) || rules[issue.type].action === 'error') {
497497
failures.push(issue)
498498
} else if (rules[issue.type].action == 'warn') {
499499
warns.push(issue)

0 commit comments

Comments
 (0)