File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
packages/angular/cli/src/command-builder Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -204,13 +204,18 @@ export abstract class SchematicsCommandModule
204204 ? {
205205 name : item ,
206206 value : item ,
207- checked : item === definition . default ,
207+ checked : Array . isArray ( definition . default )
208+ ? definition . default ?. includes ( item )
209+ : item === definition . default ,
208210 }
209211 : {
210212 ...item ,
211213 name : item . label ,
212214 value : item . value ,
213- checked : item . value === definition . default ,
215+ checked : Array . isArray ( definition . default )
216+ ? // eslint-disable-next-line @typescript-eslint/no-explicit-any
217+ definition . default ?. includes ( item . value as any )
218+ : item . value === definition . default ,
214219 } ,
215220 ) ,
216221 } ) ;
Original file line number Diff line number Diff line change @@ -197,15 +197,19 @@ export async function parseJsonSchemaToOptions(
197197 . filter ( ( value ) => isValidTypeForEnum ( typeof value ) )
198198 . sort ( ) as ( string | true | number ) [ ] ;
199199
200- let defaultValue : string | number | boolean | undefined = undefined ;
200+ let defaultValue : string | number | boolean | unknown [ ] | undefined = undefined ;
201201 if ( current . default !== undefined ) {
202202 switch ( types [ 0 ] ) {
203203 case 'string' :
204- case 'array' :
205204 if ( typeof current . default == 'string' ) {
206205 defaultValue = current . default ;
207206 }
208207 break ;
208+ case 'array' :
209+ if ( Array . isArray ( current . default ) ) {
210+ defaultValue = current . default ;
211+ }
212+ break ;
209213 case 'number' :
210214 if ( typeof current . default == 'number' ) {
211215 defaultValue = current . default ;
You can’t perform that action at this time.
0 commit comments