@@ -156,7 +156,8 @@ function indentTextContent(text: string, numSpaces: number): string {
156
156
export function buildComponent ( options : ComponentOptions ,
157
157
additionalFiles : { [ key : string ] : string } = { } ) : Rule {
158
158
159
- return async ( host : Tree , context : FileSystemSchematicContext ) => {
159
+ return async ( host , ctx ) => {
160
+ const context = ctx as FileSystemSchematicContext ;
160
161
const workspace = await getWorkspace ( host ) ;
161
162
const project = getProjectFromWorkspace ( workspace , options . project ) ;
162
163
const defaultComponentOptions = getDefaultComponentOptions ( project ) ;
@@ -175,12 +176,10 @@ export function buildComponent(options: ComponentOptions,
175
176
// Add the default component option values to the options if an option is not explicitly
176
177
// specified but a default component option is available.
177
178
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 ] ) ;
184
183
185
184
if ( options . path === undefined ) {
186
185
// TODO(jelbourn): figure out if the need for this `as any` is a bug due to two different
0 commit comments