Skip to content

Commit 78460e9

Browse files
ddubravaalan-agius4
authored andcommitted
fix(@angular/cli): remove type casting and add optional chaining for current in optionTransforms
1 parent bbf88ab commit 78460e9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/angular/cli/src/command-builder/schematics-command-module.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ export abstract class SchematicsCommandModule
120120
// Add configuration file defaults
121121
async (schematic, current) => {
122122
const projectName =
123-
typeof (current as Record<string, unknown>).project === 'string'
124-
? ((current as Record<string, unknown>).project as string)
125-
: this.getProjectName();
123+
typeof current?.project === 'string' ? current.project : this.getProjectName();
126124

127125
return {
128126
...(await getSchematicDefaults(schematic.collection.name, schematic.name, projectName)),

0 commit comments

Comments
 (0)