Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 16, 2022
1 parent ebf0afc commit ef3a6fb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import { cleanObject } from '../utils/clean.js'

// Add default configuration properties
export const addDefaultConfig = function (config, command) {
return cleanObject({
const defaultConfig = getDefaultConfig(config, command)
return cleanObject({ ...defaultConfig, ...config })
}

const getDefaultConfig = function (config, command) {
return {
...DEFAULT_CONFIG,
cwd: getCwd(),
force: !isTtyInput(),
merge: getDefaultId(),
showSystem: getDefaultShowSystem(config),
showMetadata: METADATA_COMMANDS.has(command),
...config,
})
}
}

const getDefaultShowSystem = function ({ system = {} }) {
Expand Down

0 comments on commit ef3a6fb

Please sign in to comment.