fix(angular-devkit): correctly parse inline boolean values in CLI options - #34201
Closed
alan-agius4 wants to merge 6 commits into
Closed
alan-agius4 wants to merge 6 commits into
alan-agius4 wants to merge 6 commits into
Conversation
…alues in CLI options
When CLI options defined as boolean are provided with inline values like '--debug=false' or '--dry-run=false', 'node:util.parseArgs' in non-strict mode returns string values ('false' / 'true') rather than booleans. This caused false values to be treated as truthy.
Normalize string boolean values in CLI options.
Closes angular#34199
… in CLI options
When CLI options defined as boolean are provided with inline values like '--verbose=false', 'node:util.parseArgs' in non-strict mode returns string values ('false' / 'true') rather than booleans.
Normalize string boolean values in CLI options.
There was a problem hiding this comment.
Code Review
This pull request introduces logic to parse explicit string representations of booleans ('true' and 'false') into actual boolean values within both the architect and schematics CLI parsers, accompanied by comprehensive unit tests. The feedback suggests simplifying this parsing logic in both files by removing the redundant typeof value === 'string' check, as strict equality comparisons with 'true' and 'false' already guarantee the type.
…olean values in CLI options
… values in CLI options
clydin
approved these changes
Sep 29, 2026
…olean values in CLI options
… values in CLI options
Collaborator
Author
alan-agius4
added a commit
that referenced
this pull request
Sep 29, 2026
…alues in CLI options (#34201) When CLI options defined as boolean are provided with inline values like '--debug=false' or '--dry-run=false', 'node:util.parseArgs' in non-strict mode returns string values ('false' / 'true') rather than booleans. This caused false values to be treated as truthy. Normalize string boolean values in CLI options. Closes #34199 PR Close #34201
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this pull request
Sep 29, 2026
… in CLI options (angular#34201) When CLI options defined as boolean are provided with inline values like '--verbose=false', 'node:util.parseArgs' in non-strict mode returns string values ('false' / 'true') rather than booleans. Normalize string boolean values in CLI options. PR Close angular#34201
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When CLI options defined as boolean are provided with inline values like
--debug=falseor--dry-run=false, Node'snode:util.parseArgsin non-strict mode returns string values ('false'/'true') rather than booleans. This caused false values to evaluate as truthy.Normalize string boolean values in CLI options for both
@angular-devkit/schematics-cliand@angular-devkit/architect.Closes #34199