Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 23, 2022
1 parent b6e753a commit 73ac180
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/config/normalize/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,20 @@ const showDiff = {
},
}

const showMetadata = {
default: true,
transform(value, { name }) {
checkBoolean(value, name)
const showMetadata = [
{
condition(value, { context: { command } }) {
return command === 'run'
},
default: false,
},
}

// `showMetadata` configuration property specific logic for the `run` command
const showMetadataRun = {
...showMetadata,
default: false,
}
{
default: true,
transform(value, { name }) {
checkBoolean(value, name)
},
},
]

const showPrecision = {
default: false,
Expand Down Expand Up @@ -362,7 +364,7 @@ export const COMMANDS_PROPS = {
select,
'select[*]': selectAny,
showDiff,
showMetadata: showMetadataRun,
showMetadata,
showPrecision,
showSystem,
showTitles,
Expand Down

0 comments on commit 73ac180

Please sign in to comment.