mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed SonarQube issues.
This commit is contained in:
committed by
Akshay Joshi
parent
76a6feb2e7
commit
93f5fbc797
@@ -27,7 +27,7 @@ export function minMaxValidator(label, value, minValue, maxValue) {
|
||||
export function numberValidator(label, value) {
|
||||
if((_.isUndefined(value) || _.isNull(value) || String(value) === ''))
|
||||
return null;
|
||||
if (!/^-?[0-9]+(\.?[0-9]*)?$/.test(value)) {
|
||||
if (!/^-?\d+(\.?\d*)$/.test(value)) {
|
||||
return sprintf(pgAdmin.Browser.messages.MUST_BE_NUM, label);
|
||||
}
|
||||
return null;
|
||||
@@ -37,7 +37,7 @@ export function numberValidator(label, value) {
|
||||
export function integerValidator(label, value) {
|
||||
if((_.isUndefined(value) || _.isNull(value) || String(value) === ''))
|
||||
return null;
|
||||
if (!/^-?[0-9]*$/.test(value)) {
|
||||
if (!/^-?\d*$/.test(value)) {
|
||||
return sprintf(pgAdmin.Browser.messages.MUST_BE_INT, label);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user