Skip to content

Commit dbd81a7

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

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/angular_devkit/schematics_cli/bin/schematics.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,16 @@ function parseOptions(args: string[]): Options {
520520
}
521521
}
522522

523-
// Type inference for numbers
524-
if (typeof value === 'string' && !isNaN(Number(value))) {
525-
value = Number(value);
523+
if (typeof value === 'string') {
524+
if (!isNaN(Number(value))) {
525+
// Type inference for numbers
526+
value = Number(value);
527+
} else if (value === 'true') {
528+
// Type inference for booleans
529+
value = true;
530+
} else if (value === 'false') {
531+
value = false;
532+
}
526533
}
527534

528535
const camelName = strings.camelize(name);

0 commit comments

Comments
 (0)