Skip to content

Commit b7bc02c

Browse files
committed
fix(@angular-devkit/architect): Add boolean type inference for 'true' and 'false' string values in argument parsing
Handles booleans correctly Closes #32361
1 parent 40d50aa commit b7bc02c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/angular_devkit/architect/bin/architect.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,16 @@ function parseOptions(args: string[]): Options {
180180
}
181181
}
182182

183-
// Type inference for numbers
184-
if (typeof value === 'string' && !isNaN(Number(value))) {
185-
value = Number(value);
183+
if (typeof value === 'string') {
184+
if (!isNaN(Number(value))) {
185+
// Type inference for numbers
186+
value = Number(value);
187+
} else if (value === 'true') {
188+
// Type inference for booleans
189+
value = true;
190+
} else if (value === 'false') {
191+
value = false;
192+
}
186193
}
187194

188195
const camelName = strings.camelize(name);

0 commit comments

Comments
 (0)