From 07eb474ab70d2e0dc95c4101c5532d791f06ada0 Mon Sep 17 00:00:00 2001 From: "Balazs E. Pataki" Date: Tue, 3 Sep 2024 20:34:31 +0200 Subject: [PATCH] Fix case when config.fieldOverrides is undefined --- generator/config.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/generator/config.js b/generator/config.js index bbf9c2a..480c941 100644 --- a/generator/config.js +++ b/generator/config.js @@ -72,7 +72,9 @@ 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 @@ -80,8 +82,9 @@ exports.mergeConfigs = function mergeConfigs(args, config) { } 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())