Skip to content

Commit

Permalink
Fix new remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 6, 2022
1 parent 567ce24 commit 9583841
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/config/normalize/lib/entry.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyRule } from './apply.js'
import { addMoves } from './move.js'
import { getOpts } from './opts.js'
import { set, equals } from './star_dot_path/main.js'
import { set, remove, equals } from './star_dot_path/main.js'
import { addWarnings } from './warn.js'

// Apply rule for a specific entry
Expand Down Expand Up @@ -45,6 +45,8 @@ export const applyEntryRule = async function (
const setConfigValue = function ({ config, namePath, renamedPath, newValue }) {
const configA = equals(namePath, renamedPath)
? config
: set(config, namePath, undefined)
return set(configA, renamedPath, newValue)
: remove(config, namePath)
return newValue === undefined
? remove(configA, renamedPath)
: set(configA, renamedPath, newValue)
}

0 comments on commit 9583841

Please sign in to comment.