Skip to content

Commit d66f1fe

Browse files
committed
fix(@angular-devkit/architect): Add boolean type inference for 'true' and 'false' string values in argument parsing
Handles booleans correctly Closes angular#32361 (cherry picked from commit 247855c)
1 parent e7458c8 commit d66f1fe

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
@@ -178,9 +178,16 @@ function parseOptions(args: string[]): Options {
178178
}
179179
}
180180

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

186193
const camelName = strings.camelize(name);

0 commit comments

Comments
 (0)