Convert the string "0" to number 0 (#19080)

1. Fixes #19046

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2023-08-03 21:52:49 +08:00 committed by GitHub
parent d34775296c
commit 530b78285b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, '');