Skip to content

Commit

Permalink
fix: which config
Browse files Browse the repository at this point in the history
The default value for the `which` config option used in the `npm fund`
command is now `null` instead of the previously used `undefined`.
  • Loading branch information
ruyadorno committed Mar 22, 2021
1 parent 15ee1ae commit b7b4491
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/fund.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Fund extends BaseCommand {
const fundingSourceNumber = numberArg && parseInt(numberArg, 10)

const badFundingSourceNumber =
numberArg !== undefined &&
numberArg !== null &&
(String(fundingSourceNumber) !== numberArg || fundingSourceNumber < 1)

if (badFundingSourceNumber) {
Expand Down
6 changes: 3 additions & 3 deletions test/lib/fund.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const config = {
json: false,
global: false,
unicode: false,
which: undefined,
which: null,
}
const openUrl = async (npm, url, msg) => {
if (url === 'http://npmjs.org')
Expand Down Expand Up @@ -563,7 +563,7 @@ test('fund using nested packages with multiple sources, with a source number', t
t.ifError(err, 'should not error out')
t.matchSnapshot(printUrl, 'should open the numbered URL')

config.which = undefined
config.which = null
printUrl = ''
t.end()
})
Expand Down Expand Up @@ -663,7 +663,7 @@ test('fund using bad which value', t => {
'should have bad which option error message'
)

config.which = undefined
config.which = null
result = ''
t.end()
})
Expand Down

0 comments on commit b7b4491

Please # to comment.