1var CustomValidation; 2(function (CustomValidation) { 3 var errors = null; 4 function useFormValidation(reactive) { 5 if (!errors) { 6 errors = reactive({}); 7 } 8 var isEmpty = function (fieldName, fieldValue) { 9 errors[fieldName] = fieldValue === "" ? "The " + fieldName + " field is required" : ""; 10 }; 11 var minLength = function (fieldName, fieldValue, min) { 12 errors[fieldName] = fieldValue.length < min ? "The ".concat(fieldName, " field must be atleast ").concat(min, " characters long") : ""; 13 }; 14 var isEmail = function (fieldName, fieldValue) { 15 var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 16 errors[fieldName] = !re.test(fieldValue) ? "The ".concat(fieldName, " is not a valid email address") : ""; 17 }; 18 return { errors: errors, isEmpty: isEmpty, minLength: minLength, isEmail: isEmail }; 19 } 20 CustomValidation.useFormValidation = useFormValidation; 21})(CustomValidation || (CustomValidation = {}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.