messages.js 1.4 KB

1
  1. "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var Messages={type:function type(a,b,c){return"function"==typeof c&&(c=c.name),"".concat(a," must be of type ").concat(c,".")},required:function required(a){return"".concat(a," is required.")},match:function match(a,b,c){return"".concat(a," must match ").concat(c,".")},length:function length(a,b,c){if("number"==typeof c)return"".concat(a," must have a length of ").concat(c,".");var d=c.min,e=c.max;return d&&e?"".concat(a," must have a length between ").concat(d," and ").concat(e,"."):e?"".concat(a," must have a maximum length of ").concat(e,"."):d?"".concat(a," must have a minimum length of ").concat(d,"."):void 0},size:function size(a,b,c){if("number"==typeof c)return"".concat(a," must have a size of ").concat(c,".");var d=c.min,e=c.max;return void 0!==d&&void 0!==e?"".concat(a," must be between ").concat(d," and ").concat(e,"."):void 0===e?void 0===d?void 0:"".concat(a," must be greater than ").concat(d,"."):"".concat(a," must be less than ").concat(e,".")},enum:function _enum(a,b,c){var d=c.slice(),e=d.pop();return"".concat(a," must be either ").concat(d.join(", ")," or ").concat(e,".")},illegal:function illegal(a){return"".concat(a," is not allowed.")},default:function _default(a){return"Validation failed for ".concat(a,".")}},_default2=Messages;exports["default"]=_default2,module.exports=exports.default;