SB-6.1-PRE

This commit is contained in:
ItzEmerald committed 2021-02-02 13:50:53 +00:00
1 parent 690169a409
commit 358a25f522
3760 files changed
+300059 -36

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tslib"),require("validator"),require("google-libphonenumber")):"function"==typeof define&&define.amd?define(["exports","tslib","validator","google-libphonenumber"],n):n((t=t||self).ClassValidator={},t.tslib_1,t.validator,t.googleLibphonenumber)}(this,function(t,i,e,a){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var o=function(t){this.groups=[],this.always=!1,this.each=!1,this.context=void 0,this.type=t.type,this.target=t.target,this.propertyName=t.propertyName,this.constraints=t.constraints,this.constraintCls=t.constraintCls,this.validationTypeOptions=t.validationTypeOptions,t.validationOptions&&(this.message=t.validationOptions.message,this.groups=t.validationOptions.groups,this.always=t.validationOptions.always,this.each=t.validationOptions.each,this.context=t.validationOptions.context)},r=(n.prototype.transform=function(a){var i=[];return Object.keys(a.properties).forEach(function(e){a.properties[e].forEach(function(t){var n={message:t.message,groups:t.groups,always:t.always,each:t.each},r={type:t.type,target:a.name,propertyName:e,constraints:t.constraints,validationTypeOptions:t.options,validationOptions:n};i.push(new o(r))})}),i},n);function n(){}function s(){return"undefined"!=typeof window&&(window.global=window),global.classValidatorMetadataStorage||(global.classValidatorMetadataStorage=new u),global.classValidatorMetadataStorage}var u=(Object.defineProperty(c.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.length},enumerable:!0,configurable:!0}),c.prototype.addValidationSchema=function(t){var n=this;(new r).transform(t).forEach(function(t){return n.addValidationMetadata(t)})},c.prototype.addValidationMetadata=function(t){this.validationMetadatas.push(t)},c.prototype.addConstraintMetadata=function(t){this.constraintMetadatas.push(t)},c.prototype.groupByPropertyName=function(t){var n={};return t.forEach(function(t){n[t.propertyName]||(n[t.propertyName]=[]),n[t.propertyName].push(t)}),n},c.prototype.getTargetValidationMetadatas=function(n,r,e){var t=this.validationMetadatas.filter(function(t){return(t.target===n||t.target===r)&&(!!t.always||!(e&&0<e.length)||t.groups&&!!t.groups.find(function(t){return-1!==e.indexOf(t)}))}),a=this.validationMetadatas.filter(function(t){return"string"!=typeof t.target&&t.target!==n&&(!(t.target instanceof Function)||n.prototype instanceof t.target)&&(!!t.always||!(e&&0<e.length)||t.groups&&!!t.groups.find(function(t){return-1!==e.indexOf(t)}))}).filter(function(n){return!t.find(function(t){return t.propertyName===n.propertyName&&t.type===n.type})});return t.concat(a)},c.prototype.getTargetValidatorConstraints=function(n){return this.constraintMetadatas.filter(function(t){return t.target===n})},c);function c(){this.validationMetadatas=[],this.constraintMetadatas=[]}var l=(f.prototype.toString=function(n,t,r){var e=this;function a(t){return" - property "+i+r+t+o+" has failed the following constraints: "+i+Object.keys(e.constraints).join(", ")+o+" \n"}void 0===n&&(n=!1),void 0===t&&(t=!1),void 0===r&&(r="");var i=n?"":"",o=n?"":"";if(t){var s=Number.isInteger(+this.property)?"["+this.property+"]":(r?".":"")+this.property;return this.constraints?a(s):this.children.map(function(t){return t.toString(n,!0,r+s)}).join("")}return"An instance of "+i+(this.target?this.target.constructor.name:"an object")+o+" has failed the validation:\n"+(this.constraints?a(this.property):"")+this.children.map(function(t){return t.toString(n,!0,e.property)}).join("")},f);function f(){}var d=(p.isValid=function(t){var n=this;return"isValid"!==t&&"getMessage"!==t&&-1!==Object.keys(this).map(function(t){return n[t]}).indexOf(t)},p.CUSTOM_VALIDATION="customValidation",p.NESTED_VALIDATION="nestedValidation",p.PROMISE_VALIDATION="promiseValidation",p.CONDITIONAL_VALIDATION="conditionalValidation",p.WHITELIST="whitelistValidation",p.IS_DEFINED="isDefined",p);function p(){}var v=(m.replaceMessageSpecialTokens=function(t,n){var r;return t instanceof Function?r=t(n):"string"==typeof t&&(r=t),r&&n.constraints instanceof Array&&n.constraints.forEach(function(t,n){r=r.replace(new RegExp("\\$constraint"+(n+1),"g"),t)}),r&&void 0!==n.value&&null!==n.value&&"string"==typeof n.value&&(r=r.replace(/\$value/g,n.value)),r=(r=r&&r.replace(/\$property/g,n.property))&&r.replace(/\$target/g,n.targetName)},m);function m(){}function g(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}var y=(I.prototype.execute=function(a,t,i){var o=this;this.metadataStorage.hasValidationMetaData||console.warn("No metadata found. There is more than once class-validator version installed probably. You need to flatten your dependencies.");var n=this.validatorOptions?this.validatorOptions.groups:void 0,r=this.metadataStorage.getTargetValidationMetadatas(a.constructor,t,n),s=this.metadataStorage.groupByPropertyName(r);if(this.validatorOptions&&this.validatorOptioLine truncated
//# sourceMappingURL=index.umd.min.js.map