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

Function emptyValidator

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

Source from the content-addressed store, hash-verified

48
49/* Validate value to check if it is empty */
50export function emptyValidator(label, value) {
51 if(isEmptyString(value)) {
52 return sprintf(pgAdmin.Browser.messages.CANNOT_BE_EMPTY, label);
53 }
54 return null;
55}
56
57export function isEmptyString(value) {
58 return _.isUndefined(value) || _.isNull(value) || String(value).trim() === '' || String(value).replace(/(^\s+)|(\s+$)/g, '') == '';

Callers 5

validateMethod · 0.90
validateMethod · 0.90
validateMethod · 0.90
validateMethod · 0.90
validateSchemaFunction · 0.90

Calls 2

sprintfFunction · 0.90
isEmptyStringFunction · 0.85

Tested by

no test coverage detected