Skip to content

Commit

Permalink
[npm#5280] Review feedback: do not force save on save-exact
Browse files Browse the repository at this point in the history
  • Loading branch information
ficocelliguy committed Feb 20, 2024
1 parent 0b07587 commit 0b5416c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions workspaces/config/lib/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1827,9 +1827,6 @@ define('save-exact', {
version rather than using npm's default semver range operator.
`,
flatten (key, obj, flatOptions) {
if (obj[key]) {
flatOptions.save = true
}
// just call the save-prefix flattener, it reads from obj['save-exact']
definitions['save-prefix'].flatten('save-prefix', obj, flatOptions)
},
Expand Down
5 changes: 2 additions & 3 deletions workspaces/config/test/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,11 +814,10 @@ t.test('save-exact', t => {
'save-exact': true,
'save-prefix': '~1.2.3',
}
let flat = {}
const flat = {}
mockDefs()['save-exact']
.flatten('save-exact', { ...obj, 'save-exact': true }, flat)
t.strictSame(flat, { savePrefix: '', save: true })
flat = {}
t.strictSame(flat, { savePrefix: '' })
mockDefs()['save-exact']
.flatten('save-exact', { ...obj, 'save-exact': false }, flat)
t.strictSame(flat, { savePrefix: '~1.2.3' })
Expand Down

0 comments on commit 0b5416c

Please sign in to comment.