@@ -156,7 +156,8 @@ function indentTextContent(text: string, numSpaces: number): string {
156156export function buildComponent ( options : ComponentOptions ,
157157 additionalFiles : { [ key : string ] : string } = { } ) : Rule {
158158
159- return async ( host : Tree , context : FileSystemSchematicContext ) => {
159+ return async ( host , ctx ) => {
160+ const context = ctx as FileSystemSchematicContext ;
160161 const workspace = await getWorkspace ( host ) ;
161162 const project = getProjectFromWorkspace ( workspace , options . project ) ;
162163 const defaultComponentOptions = getDefaultComponentOptions ( project ) ;
@@ -175,12 +176,10 @@ export function buildComponent(options: ComponentOptions,
175176 // Add the default component option values to the options if an option is not explicitly
176177 // specified but a default component option is available.
177178 Object . keys ( options )
178- . filter ( ( optionName : keyof ComponentOptions ) => {
179- return options [ optionName ] == null && defaultComponentOptions [ optionName ] ;
180- } )
181- . forEach ( ( optionName : keyof ComponentOptions ) => {
182- ( options as any ) [ optionName ] = ( defaultComponentOptions as ComponentOptions ) [ optionName ] ;
183- } ) ;
179+ . filter ( key => options [ key as keyof ComponentOptions ] == null &&
180+ defaultComponentOptions [ key as keyof ComponentOptions ] )
181+ . forEach ( key => ( options as any ) [ key ] =
182+ ( defaultComponentOptions as ComponentOptions ) [ key as keyof ComponentOptions ] ) ;
184183
185184 if ( options . path === undefined ) {
186185 // TODO(jelbourn): figure out if the need for this `as any` is a bug due to two different
0 commit comments