Skip to content

Commit

Permalink
[Cherry-pick]Convert the string "0" to number 0 (#19082)
Browse files Browse the repository at this point in the history
Convert the string "0" to number 0
1. Fixes #19046

Signed-off-by: AllForNothing <[email protected]>
  • Loading branch information
AllForNothing authored Aug 3, 2023
1 parent b2a75dc commit c1bb162
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export class AddRuleComponent {
}

add() {
// convert string "0" to number 0
if (this.rule.params[this.template] === '0') {
this.rule.params[this.template] = 0;
}
// remove whitespaces
this.rule.scope_selectors.repository[0].pattern =
this.rule.scope_selectors.repository[0].pattern.replace(/\s+/g, '');
Expand Down

0 comments on commit c1bb162

Please sign in to comment.