Skip to content

Commit

Permalink
Fix case when config.fieldOverrides is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
beepsoft committed Sep 3, 2024
1 parent b26ea1d commit 07eb474
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions generator/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@ exports.mergeConfigs = function mergeConfigs(args, config) {
!!args["--useIdentifierNumber"] || config.useIdentifierNumber,
fieldOverrides: args["--fieldOverrides"]
? parseFieldOverrides(args["--fieldOverrides"])
: parseFieldOverrides(config.fieldOverrides),
: config.fieldOverrides
? parseFieldOverrides(config.fieldOverrides)
: [],
dynamicArgs: !!args["--dynamicArgs"] || config.dynamicArgs,
debug: !!args["--debug"] || config.debug,
disableLogColors: !!args["--disableLogColors"] || config.disableLogColors
}
}

const parseFieldOverrides = (fieldOverrides) => {
const _fieldOverrides =
Array.isArray(fieldOverrides) ? fieldOverrides : fieldOverrides.split(",");
const _fieldOverrides = Array.isArray(fieldOverrides)
? fieldOverrides
: fieldOverrides.split(",")

return _fieldOverrides
.map((s) => s.trim())
Expand Down

0 comments on commit 07eb474

Please sign in to comment.