@@ -255,7 +255,7 @@ export default {
255
255
this . writeDefaultConfig ( this . projectHelper . projectDir ) ;
256
256
}
257
257
258
- if ( typeof value === "object" ) {
258
+ if ( ! Array . isArray ( value ) && typeof value === "object" ) {
259
259
let allSuccessful = true ;
260
260
261
261
for ( const prop of this . flattenObjectToPaths ( value ) ) {
@@ -298,7 +298,7 @@ export default {
298
298
this . $logger . error ( `Failed to update config.` + error ) ;
299
299
} finally {
300
300
// verify config is updated correctly
301
- if ( this . getValue ( key ) !== value ) {
301
+ if ( ! Array . isArray ( this . getValue ( key ) ) && this . getValue ( key ) !== value ) {
302
302
this . $logger . error (
303
303
`${ EOL } Failed to update ${
304
304
hasTSConfig ? CONFIG_FILE_NAME_TS : CONFIG_FILE_NAME_JS
@@ -465,7 +465,15 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
465
465
) : Array < { key : string ; value : any } > {
466
466
const toPath = ( key : any ) => [ basePath , key ] . filter ( Boolean ) . join ( "." ) ;
467
467
return Object . keys ( obj ) . reduce ( ( all : any , key ) => {
468
- if ( typeof obj [ key ] === "object" ) {
468
+ if ( Array . isArray ( obj [ key ] ) ) {
469
+ return [
470
+ ...all ,
471
+ {
472
+ key : toPath ( key ) ,
473
+ value : obj [ key ] , // Preserve arrays as they are
474
+ } ,
475
+ ] ;
476
+ } else if ( typeof obj [ key ] === "object" && obj [ key ] !== null ) {
469
477
return [ ...all , ...this . flattenObjectToPaths ( obj [ key ] , toPath ( key ) ) ] ;
470
478
}
471
479
return [
0 commit comments