MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / integerValidator

Function integerValidator

web/pgadmin/static/js/validators.js:40–47  ·  view source on GitHub ↗
(label, value)

Source from the content-addressed store, hash-verified

38
39/* Validate value to check if it is an integer */
40export function integerValidator(label, value) {
41 if((_.isUndefined(value) || _.isNull(value) || String(value) === ''))
42 return null;
43 if (!/^-?\d*$/.test(value)) {
44 return sprintf(pgAdmin.Browser.messages.MUST_BE_INT, label);
45 }
46 return null;
47}
48
49/* Validate value to check if it is empty */
50export function emptyValidator(label, value) {

Callers 1

validateSchemaFunction · 0.90

Calls 2

sprintfFunction · 0.90
testMethod · 0.80

Tested by

no test coverage detected