validation/serverMessages.js
/**
 * msg - Create a list of error Codes and custom messages for Server errors,
 * customized based on the parameters
 *
 * @param {String} name - Descriptive name of the field
 * @param {String} errorCode - The message code
 * @return {String}
 */
Create a list of error Codes and custom messages for Server errors,
customized based on the parameters

@param {String} name - Descriptive name of the field
@param {String} errorCode - The message code
@return {String}
Create a list of error Codes and custom messages for Server errors customized based on the parameters @param { String } name - Descriptive name of the field @param { String } errorCode - The message code @return { String }
function msg(name, errorCode) {
  name = name.charAt(0).toUpperCase() + name.slice(1)
  return messages[errorCode].replace('<name>', name)
}
function msg ( name , errorCode ) { name = name . charAt ( 0 ) . toUpperCase ( ) + name . slice ( 1 ) return messages [ errorCode ] . replace ( '<name>' , name ) }
msg - Create a list of error Codes and custom messages for Server errors,
 customized based on the parameters
msg - Create a list of error Codes and custom messages for Server errors customized based on the parameters
/** Capitalize the input field name for nicer presentation */