diff options
author | Gar <gar+gh@danger.computer> | 2021-03-24 17:40:21 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-03-24 17:52:54 +0300 |
commit | dce4960ef6d52af128affe7755b2ca72de913b6c (patch) | |
tree | d7eab73ed9420bce24cd75be6ded97f9c72ac239 /lib | |
parent | 543b0e39bcb94fc408804b01ca9c0d7b960b2681 (diff) |
fix(config): flatten savePrefix properly
It needs to take save-exact into consideration
Closes: https://github.com/npm/cli/issues/2932
PR-URL: https://github.com/npm/cli/pull/2937
Credit: @wraithgar
Close: #2937
Reviewed-by: @ruyadorno
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/config/definitions.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index a6ecbcd0c..5001efb46 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -1581,7 +1581,9 @@ define('save-prefix', { \`npm config set save-prefix='~'\` it would be set to \`~1.2.3\` which only allows patch upgrades. `, - flatten, + flatten (key, obj, flatOptions) { + flatOptions.savePrefix = obj['save-exact'] ? '' : obj['save-prefix'] + }, }) define('save-prod', { |