Skip to content

Commit

Permalink
Convert the string "0" to number 0
Browse files Browse the repository at this point in the history
1. Fixes goharbor#19046

Signed-off-by: AllForNothing <[email protected]>
  • Loading branch information
AllForNothing committed Aug 3, 2023
1 parent d347752 commit be7a3f6
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 be7a3f6

Please sign in to comment.