@lemoncode/fonk
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -25,18 +25,2 @@ 'use strict'; | ||
function _defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
} | ||
function _slicedToArray(arr, i) { | ||
@@ -1415,60 +1399,50 @@ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
var FormValidation = | ||
/*#__PURE__*/ | ||
function () { | ||
function FormValidation(validationSchema) { | ||
_classCallCheck(this, FormValidation); | ||
var FormValidation = function FormValidation(validationSchema) { | ||
var _this = this; | ||
this.fieldSchema = {}; | ||
this.recordSchema = {}; | ||
this.setupValidationSchema(validationSchema); | ||
} | ||
_classCallCheck(this, FormValidation); | ||
_createClass(FormValidation, [{ | ||
key: "setupValidationSchema", | ||
value: function setupValidationSchema(validationSchema) { | ||
if (validationSchema && _typeof(validationSchema) === 'object') { | ||
var record = validationSchema.record, | ||
field = validationSchema.field; | ||
this.fieldSchema = {}; | ||
this.recordSchema = {}; | ||
if (field && _typeof(field) === 'object') { | ||
this.fieldSchema = mapToInternalFieldValidationSchema(validationSchema.field); | ||
} | ||
this.setupValidationSchema = function (validationSchema) { | ||
if (validationSchema && _typeof(validationSchema) === 'object') { | ||
var record = validationSchema.record, | ||
field = validationSchema.field; | ||
if (record && _typeof(record) === 'object') { | ||
this.recordSchema = mapToInternalRecordValidationSchema(validationSchema.record); | ||
} | ||
} else { | ||
console.error('ValidationSchema must be a valid object'); | ||
if (field && _typeof(field) === 'object') { | ||
_this.fieldSchema = mapToInternalFieldValidationSchema(validationSchema.field); | ||
} | ||
} | ||
}, { | ||
key: "validateField", | ||
value: function validateField$1(fieldId, value, values) { | ||
return validateField(fieldId, value, values, this.fieldSchema).then(function (_a) { | ||
var key = _a.key, | ||
validationResult = __rest(_a, ["key"]); | ||
return Object.assign({}, validationResult); | ||
}); | ||
if (record && _typeof(record) === 'object') { | ||
_this.recordSchema = mapToInternalRecordValidationSchema(validationSchema.record); | ||
} | ||
} else { | ||
console.error('ValidationSchema must be a valid object'); | ||
} | ||
}, { | ||
key: "validateRecord", | ||
value: function validateRecord$1(values) { | ||
return validateRecord(values, this.recordSchema); | ||
} | ||
}, { | ||
key: "validateForm", | ||
value: function validateForm$1(values) { | ||
return validateForm(values, this.fieldSchema, this.recordSchema); | ||
} | ||
}, { | ||
key: "updateValidationSchema", | ||
value: function updateValidationSchema(validationSchema) { | ||
this.setupValidationSchema(validationSchema); | ||
} | ||
}]); | ||
}; | ||
return FormValidation; | ||
}(); | ||
this.validateField = function (fieldId, value, values) { | ||
return validateField(fieldId, value, values, _this.fieldSchema).then(function (_a) { | ||
var key = _a.key, | ||
validationResult = __rest(_a, ["key"]); | ||
return Object.assign({}, validationResult); | ||
}); | ||
}; | ||
this.validateRecord = function (values) { | ||
return validateRecord(values, _this.recordSchema); | ||
}; | ||
this.validateForm = function (values) { | ||
return validateForm(values, _this.fieldSchema, _this.recordSchema); | ||
}; | ||
this.updateValidationSchema = function (validationSchema) { | ||
_this.setupValidationSchema(validationSchema); | ||
}; | ||
this.setupValidationSchema(validationSchema); | ||
}; | ||
var createFormValidation = function createFormValidation(validationSchema) { | ||
@@ -1475,0 +1449,0 @@ return new FormValidation(validationSchema); |
@@ -21,18 +21,2 @@ function _typeof(obj) { | ||
function _defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
} | ||
function _slicedToArray(arr, i) { | ||
@@ -1411,60 +1395,50 @@ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
var FormValidation = | ||
/*#__PURE__*/ | ||
function () { | ||
function FormValidation(validationSchema) { | ||
_classCallCheck(this, FormValidation); | ||
var FormValidation = function FormValidation(validationSchema) { | ||
var _this = this; | ||
this.fieldSchema = {}; | ||
this.recordSchema = {}; | ||
this.setupValidationSchema(validationSchema); | ||
} | ||
_classCallCheck(this, FormValidation); | ||
_createClass(FormValidation, [{ | ||
key: "setupValidationSchema", | ||
value: function setupValidationSchema(validationSchema) { | ||
if (validationSchema && _typeof(validationSchema) === 'object') { | ||
var record = validationSchema.record, | ||
field = validationSchema.field; | ||
this.fieldSchema = {}; | ||
this.recordSchema = {}; | ||
if (field && _typeof(field) === 'object') { | ||
this.fieldSchema = mapToInternalFieldValidationSchema(validationSchema.field); | ||
} | ||
this.setupValidationSchema = function (validationSchema) { | ||
if (validationSchema && _typeof(validationSchema) === 'object') { | ||
var record = validationSchema.record, | ||
field = validationSchema.field; | ||
if (record && _typeof(record) === 'object') { | ||
this.recordSchema = mapToInternalRecordValidationSchema(validationSchema.record); | ||
} | ||
} else { | ||
console.error('ValidationSchema must be a valid object'); | ||
if (field && _typeof(field) === 'object') { | ||
_this.fieldSchema = mapToInternalFieldValidationSchema(validationSchema.field); | ||
} | ||
} | ||
}, { | ||
key: "validateField", | ||
value: function validateField$1(fieldId, value, values) { | ||
return validateField(fieldId, value, values, this.fieldSchema).then(function (_a) { | ||
var key = _a.key, | ||
validationResult = __rest(_a, ["key"]); | ||
return Object.assign({}, validationResult); | ||
}); | ||
if (record && _typeof(record) === 'object') { | ||
_this.recordSchema = mapToInternalRecordValidationSchema(validationSchema.record); | ||
} | ||
} else { | ||
console.error('ValidationSchema must be a valid object'); | ||
} | ||
}, { | ||
key: "validateRecord", | ||
value: function validateRecord$1(values) { | ||
return validateRecord(values, this.recordSchema); | ||
} | ||
}, { | ||
key: "validateForm", | ||
value: function validateForm$1(values) { | ||
return validateForm(values, this.fieldSchema, this.recordSchema); | ||
} | ||
}, { | ||
key: "updateValidationSchema", | ||
value: function updateValidationSchema(validationSchema) { | ||
this.setupValidationSchema(validationSchema); | ||
} | ||
}]); | ||
}; | ||
return FormValidation; | ||
}(); | ||
this.validateField = function (fieldId, value, values) { | ||
return validateField(fieldId, value, values, _this.fieldSchema).then(function (_a) { | ||
var key = _a.key, | ||
validationResult = __rest(_a, ["key"]); | ||
return Object.assign({}, validationResult); | ||
}); | ||
}; | ||
this.validateRecord = function (values) { | ||
return validateRecord(values, _this.recordSchema); | ||
}; | ||
this.validateForm = function (values) { | ||
return validateForm(values, _this.fieldSchema, _this.recordSchema); | ||
}; | ||
this.updateValidationSchema = function (validationSchema) { | ||
_this.setupValidationSchema(validationSchema); | ||
}; | ||
this.setupValidationSchema(validationSchema); | ||
}; | ||
var createFormValidation = function createFormValidation(validationSchema) { | ||
@@ -1471,0 +1445,0 @@ return new FormValidation(validationSchema); |
@@ -27,18 +27,2 @@ (function (global, factory) { | ||
function _defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
} | ||
function _slicedToArray(arr, i) { | ||
@@ -1417,60 +1401,50 @@ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
var FormValidation = | ||
/*#__PURE__*/ | ||
function () { | ||
function FormValidation(validationSchema) { | ||
_classCallCheck(this, FormValidation); | ||
var FormValidation = function FormValidation(validationSchema) { | ||
var _this = this; | ||
this.fieldSchema = {}; | ||
this.recordSchema = {}; | ||
this.setupValidationSchema(validationSchema); | ||
} | ||
_classCallCheck(this, FormValidation); | ||
_createClass(FormValidation, [{ | ||
key: "setupValidationSchema", | ||
value: function setupValidationSchema(validationSchema) { | ||
if (validationSchema && _typeof(validationSchema) === 'object') { | ||
var record = validationSchema.record, | ||
field = validationSchema.field; | ||
this.fieldSchema = {}; | ||
this.recordSchema = {}; | ||
if (field && _typeof(field) === 'object') { | ||
this.fieldSchema = mapToInternalFieldValidationSchema(validationSchema.field); | ||
} | ||
this.setupValidationSchema = function (validationSchema) { | ||
if (validationSchema && _typeof(validationSchema) === 'object') { | ||
var record = validationSchema.record, | ||
field = validationSchema.field; | ||
if (record && _typeof(record) === 'object') { | ||
this.recordSchema = mapToInternalRecordValidationSchema(validationSchema.record); | ||
} | ||
} else { | ||
console.error('ValidationSchema must be a valid object'); | ||
if (field && _typeof(field) === 'object') { | ||
_this.fieldSchema = mapToInternalFieldValidationSchema(validationSchema.field); | ||
} | ||
} | ||
}, { | ||
key: "validateField", | ||
value: function validateField$1(fieldId, value, values) { | ||
return validateField(fieldId, value, values, this.fieldSchema).then(function (_a) { | ||
var key = _a.key, | ||
validationResult = __rest(_a, ["key"]); | ||
return Object.assign({}, validationResult); | ||
}); | ||
if (record && _typeof(record) === 'object') { | ||
_this.recordSchema = mapToInternalRecordValidationSchema(validationSchema.record); | ||
} | ||
} else { | ||
console.error('ValidationSchema must be a valid object'); | ||
} | ||
}, { | ||
key: "validateRecord", | ||
value: function validateRecord$1(values) { | ||
return validateRecord(values, this.recordSchema); | ||
} | ||
}, { | ||
key: "validateForm", | ||
value: function validateForm$1(values) { | ||
return validateForm(values, this.fieldSchema, this.recordSchema); | ||
} | ||
}, { | ||
key: "updateValidationSchema", | ||
value: function updateValidationSchema(validationSchema) { | ||
this.setupValidationSchema(validationSchema); | ||
} | ||
}]); | ||
}; | ||
return FormValidation; | ||
}(); | ||
this.validateField = function (fieldId, value, values) { | ||
return validateField(fieldId, value, values, _this.fieldSchema).then(function (_a) { | ||
var key = _a.key, | ||
validationResult = __rest(_a, ["key"]); | ||
return Object.assign({}, validationResult); | ||
}); | ||
}; | ||
this.validateRecord = function (values) { | ||
return validateRecord(values, _this.recordSchema); | ||
}; | ||
this.validateForm = function (values) { | ||
return validateForm(values, _this.fieldSchema, _this.recordSchema); | ||
}; | ||
this.updateValidationSchema = function (validationSchema) { | ||
_this.setupValidationSchema(validationSchema); | ||
}; | ||
this.setupValidationSchema(validationSchema); | ||
}; | ||
var createFormValidation = function createFormValidation(validationSchema) { | ||
@@ -1477,0 +1451,0 @@ return new FormValidation(validationSchema); |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self)["@lemoncode/fonk"]={})}(this,(function(e){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var t=[],n=!0,o=!1,u=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw u}}return t}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")} | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self)["@lemoncode/fonk"]={})}(this,(function(e){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(n=(u=a.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return t}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")} | ||
/*! ***************************************************************************** | ||
@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
and limitations under the License. | ||
***************************************************************************** */()}function o(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}var u=function(e){return function(e){return Array.isArray(e)?e.length:0}(e)>0},i=function(e){return"function"==typeof e},a=function(e){return null==e},c=function(e){return e instanceof Promise},s=function(e){return Boolean(e)?Object.keys(e):[]},l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f="Expected a function",d="__lodash_hash_undefined__",v=1/0,p="[object Function]",h="[object GeneratorFunction]",y="[object Symbol]",m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/,_=/^\./,b=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/\\(\\)?/g,j=/^\[object .+?Constructor\]$/,w="object"==r(l)&&l&&l.Object===Object&&l,O="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,A=w||O||Function("return this")();var S,P=Array.prototype,k=Function.prototype,x=Object.prototype,V=A["__core-js_shared__"],F=(S=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",R=k.toString,T=x.hasOwnProperty,M=x.toString,$=RegExp("^"+R.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=A.Symbol,z=P.splice,L=W(A,"Map"),I=W(Object,"create"),C=N?N.prototype:void 0,D=C?C.toString:void 0;function G(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}function U(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}function B(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}function H(e,r){for(var t,n,o=e.length;o--;)if((t=e[o][0])===(n=r)||t!=t&&n!=n)return o;return-1}function Z(e,t){for(var n,o=0,u=(t=function(e,t){if(Y(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||re(e))return!0;return g.test(e)||!m.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:Y(n=t)?n:X(n)).length;null!=e&&o<u;)e=e[J(t[o++])];return o&&o==u?e:void 0}function q(e){return!(!ee(e)||(r=e,F&&F in r))&&(function(e){var r=ee(e)?M.call(e):"";return r==p||r==h}(e)||function(e){var r=!1;if(null!=e&&"function"!=typeof e.toString)try{r=!!(e+"")}catch(e){}return r}(e)?$:j).test(function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var r}function Q(e,t){var n,o,u=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?u["string"==typeof t?"string":"hash"]:u.map}function W(e,r){var t=function(e,r){return null==e?void 0:e[r]}(e,r);return q(t)?t:void 0}G.prototype.clear=function(){this.__data__=I?I(null):{}},G.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},G.prototype.get=function(e){var r=this.__data__;if(I){var t=r[e];return t===d?void 0:t}return T.call(r,e)?r[e]:void 0},G.prototype.has=function(e){var r=this.__data__;return I?void 0!==r[e]:T.call(r,e)},G.prototype.set=function(e,r){return this.__data__[e]=I&&void 0===r?d:r,this},U.prototype.clear=function(){this.__data__=[]},U.prototype.delete=function(e){var r=this.__data__,t=H(r,e);return!(t<0)&&(t==r.length-1?r.pop():z.call(r,t,1),!0)},U.prototype.get=function(e){var r=this.__data__,t=H(r,e);return t<0?void 0:r[t][1]},U.prototype.has=function(e){return H(this.__data__,e)>-1},U.prototype.set=function(e,r){var t=this.__data__,n=H(t,e);return n<0?t.push([e,r]):t[n][1]=r,this},B.prototype.clear=function(){this.__data__={hash:new G,map:new(L||U),string:new G}},B.prototype.delete=function(e){return Q(this,e).delete(e)},B.prototype.get=function(e){return Q(this,e).get(e)},B.prototype.has=function(e){return Q(this,e).has(e)},B.prototype.set=function(e,r){return Q(this,e).set(e,r),this};var X=K((function(e){var r;e=null==(r=e)?"":function(e){if("string"==typeof e)return e;if(re(e))return D?D.call(e):"";var r=e+"";return"0"==r&&1/e==-v?"-0":r}(r);var t=[];return _.test(e)&&t.push(""),e.replace(b,(function(e,r,n,o){t.push(n?o.replace(E,"$1"):r||e)})),t}));function J(e){if("string"==typeof e||re(e))return e;var r=e+"";return"0"==r&&1/e==-v?"-0":r}function K(e,r){if("function"!=typeof e||r&&"function"!=typeof r)throw new TypeError(f);var t=function t(){var n=arguments,o=r?r.apply(this,n):n[0],u=t.cache;if(u.has(o))return u.get(o);var i=e.apply(this,n);return t.cache=u.set(o,i),i};return t.cache=new(K.Cache||B),t}K.Cache=B;var Y=Array.isArray;function ee(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function re(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&M.call(e)==y}var te=function(e,r,t){var n=null==e?void 0:Z(e,r);return void 0===n?t:n},ne=function(){return{type:"",succeeded:!0,message:""}},oe=function(){return{succeeded:!0,recordErrors:{}}},ue=function(){return{succeeded:!0,fieldErrors:{},recordErrors:{}}},ie=function(e){return function(r){var t=e?e(r):{type:"",succeeded:!0,message:""};return c(t)?t:Promise.resolve(t)}},ae=function(e){return function(r){var t=e?e(r):{type:"",succeeded:!0,message:""};return c(t)?t:Promise.resolve(t)}},ce=function(e){return i(e)?{validator:ie(e),message:void 0,customArgs:void 0}:{validator:ie(i(e.validator)?e.validator:e.validator.validator),customArgs:e.customArgs,message:e.message}},se=function(e){return Array.isArray(e)?e.map(ce):[]},le=function(e){var r=e instanceof Object?e:{},t=Object.entries(r).map((function(e){var r=n(e,2),t=r[0],o=r[1];return[t,se(o)]}));return t.reduce((function(e,r){var t=n(r,2),o=t[0],u=t[1];return e[o]=u,e}),{})},fe=function(e){return i(e)?{validator:ae(e),message:void 0}:{validator:ae(i(e.validator)?e.validator:e.validator.validator),message:e.message}},de=function(e){return Array.isArray(e)?e.map(fe):[]},ve=function(e){var r=e instanceof Object?e:{},t=Object.entries(r).map((function(e){var r=n(e,2),t=r[0],o=r[1];return[t,de(o)]}));return t.reduce((function(e,r){var t=n(r,2),o=t[0],u=t[1];return e[o]=u,e}),{})},pe=function(e,r,t,n){return e.map((function(e){return n(e,r,t)}))},he=function(e){var r=e;return e&&!a(e.succeeded)||(console.error("form-validators: One of the record validator is returning a non expected value."),r={key:"",type:"",succeeded:!0,message:""}),r},ye=function(e,r){return r.validator({values:e,message:r.message}).then(he)},me=function(e,r){return u(r)?function(e,r){return r.reduce((function(r,t){return r.then((function(r){return r.succeeded?ye(e,t):r}))}),ye(e,r[0]))}(e,r):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},ge=function(e){var r=e;return e&&!a(e.succeeded)||(console.error("form-validators: One of the field validator is returning a non expected value."),r={key:"",type:"",succeeded:!0,message:""}),r},_e=function(e,r,t){return t.validator({value:e,values:r,customArgs:t.customArgs,message:t.message}).then(ge)},be=function(e,r,t){return u(t)?function(e,r,t){return t.reduce((function(t,n){return t.then((function(t){return t.succeeded?_e(e,r,n):t}))}),_e(e,r,t[0]))}(e,r,t):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},Ee=function(e){return e.every((function(e){return e.succeeded}))},je=function(e){return e.reduce((function(e,r){var t=r.key,n=o(r,["key"]);return e[t]=Object.assign({},n),e}),{})},we=function(e){var r={succeeded:!0,recordErrors:{}};return u(e)&&(r.succeeded=Ee(e),r.recordErrors=je(e)),r},Oe=function(e,r){return!a(r)&&!a(r[e])},Ae=function(e,r,t,n){return Oe(e,n)?be(r,t,n[e]).then((function(r){return r.key=e,r})).catch((function(r){var t="Validation Exception, field: ".concat(e);throw console.error(t),r})):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},Se=function(e,r,t){return Oe(e,t)?me(r,t[e]).then((function(r){return r.key=e,r})).catch((function(r){var t="Validation Exception, record: ".concat(e);throw console.error(t),r})):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},Pe=function(e,r,t){var o=function(e,r,t,n){return e.map((function(e){return n(e,te(r,e,void 0),r,t)}))}(s(r),e,r,Ae),i=pe(s(t),e,t,Se);return Promise.all(o).then((function(e){return Promise.all(i).then((function(r){return[e,r]}))})).then((function(e){var r=n(e,2);return function(e,r){var t={succeeded:!0,fieldErrors:{},recordErrors:{}};if(u(e)&&(t.succeeded=Ee(e),t.fieldErrors=je(e)),u(r)){var n=we(r);t.succeeded=t.succeeded&&n.succeeded,t.recordErrors=n.recordErrors}return t}(r[0],r[1])})).catch((function(e){throw console.error("Uncontrolled error validating records"),e}))},ke=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.fieldSchema={},this.recordSchema={},this.setupValidationSchema(r)}var n,u,i;return n=e,(u=[{key:"setupValidationSchema",value:function(e){if(e&&"object"===r(e)){var t=e.record,n=e.field;n&&"object"===r(n)&&(this.fieldSchema=le(e.field)),t&&"object"===r(t)&&(this.recordSchema=ve(e.record))}else console.error("ValidationSchema must be a valid object")}},{key:"validateField",value:function(e,r,t){return Ae(e,r,t,this.fieldSchema).then((function(e){e.key;var r=o(e,["key"]);return Object.assign({},r)}))}},{key:"validateRecord",value:function(e){return function(e,r){var t=pe(s(r),e,r,Se);return Promise.all(t).then((function(e){return we(e)})).catch((function(e){throw console.error("Uncontrolled error validating records"),e}))}(e,this.recordSchema)}},{key:"validateForm",value:function(e){return Pe(e,this.fieldSchema,this.recordSchema)}},{key:"updateValidationSchema",value:function(e){this.setupValidationSchema(e)}}])&&t(n.prototype,u),i&&t(n,i),e}(),xe=function(e,r){return e?function(e,r){var t=function(e){return e.match(/{{[^{}][\w\.]*}}/g)}(e);return Array.isArray(t)?t.reduce((function(e,t){return e.replace(t,te(r,function(e){return e.replace(/[{}]/g,"")}(t),t))}),e):e}(e,r):""},Ve="Please fill in this mandatory field.",Fe={trim:!0},Re=function(e,r){return!!function(e){return null==e||""===e}(e)||r.test(e)},Te="Please enter a valid email address.",Me=/^(([^<>()\[\]\\.,;:\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,}))$/,$e="Please provide a valid format.",Ne="FieldValidationError: pattern option for pattern validation is mandatory. Example: { pattern: /d+/ }.";function ze(e){var r=e.pattern;if("boolean"==typeof r||null===r)throw new Error(Ne);return function(e){return e instanceof RegExp?e:new RegExp(e)}(r)}function Le(e,r){var t=null===e.length?NaN:Number(e.length);if(isNaN(t))throw new Error(r);return t}function Ie(e,r,t){return"string"!=typeof e||t(e,r)}var Ce="The value provided does not fulfill min length",De='FieldValidationError: Parameter "length" for minLength in customArgs is mandatory and should be a valid number. Example: { length: 4 }.',Ge=function(e,r){return e.length>=r},Ue="The value provided does not fulfill max length",Be='FieldValidationError: Parameter "length" for maxLength in customArgs is mandatory and should be a valid number. Example: { length: 4 }.',He=function(e,r){return e.length<=r},Ze={required:Object.freeze({__proto__:null,setErrorMessage:function(e){return Ve=e},validator:function(e){var r=e.value,t=e.customArgs,n=void 0===t?Fe:t,o=e.message,u=void 0===o?Ve:o,i=function(e,r){return"string"==typeof e?function(e,r){return r?e.trim().length>0:e.length>0}(e,r):function(e){return null!=e}(e)}(r,Boolean(n.trim));return{succeeded:i,message:i?"":xe(u,n),type:"REQUIRED"}}}),email:Object.freeze({__proto__:null,setErrorMessage:function(e){return Te=e},validator:function(e){var r=e.value,t=e.message,n=void 0===t?Te:t,o=function(e){return Re(e,Me)}(r);return{succeeded:o,message:o?"":n,type:"EMAIL"}}}),pattern:Object.freeze({__proto__:null,setErrorMessage:function(e){return $e=e},validator:function(e){if(!e.customArgs)throw new Error(Ne);var r=e.value,t=e.customArgs,n=void 0===t?null:t,o=e.message,u=void 0===o?$e:o,i=ze(n),a=Re(r,i);return{succeeded:a,message:a?"":xe(u,n),type:"PATTERN"}}}),minLength:Object.freeze({__proto__:null,setErrorMessage:function(e){return Ce=e},validator:function(e){if(!e.customArgs)throw new Error(De);var r=e.value,t=e.customArgs,n=void 0===t?null:t,o=e.message,u=void 0===o?Ce:o,i=Ie(r,Le(n,De),Ge);return{succeeded:i,message:i?"":xe(u,n),type:"MIN_LENGTH"}}}),maxLength:Object.freeze({__proto__:null,setErrorMessage:function(e){return Ue=e},validator:function(e){if(!e.customArgs)throw new Error(Be);var r=e.value,t=e.customArgs,n=void 0===t?null:t,o=e.message,u=void 0===o?Ue:o,i=Ie(r,Le(n,Be),He);return{succeeded:i,message:i?"":xe(u,n),type:"MAX_LENGTH"}}})};e.FormValidation=ke,e.Validators=Ze,e.createDefaultFormValidationResult=ue,e.createDefaultRecordValidationResult=oe,e.createDefaultValidationResult=ne,e.createFormValidation=function(e){return new ke(e)},e.parseMessageWithCustomArgs=xe,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */()}function n(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}var o=function(e){return function(e){return Array.isArray(e)?e.length:0}(e)>0},i=function(e){return"function"==typeof e},u=function(e){return null==e},a=function(e){return e instanceof Promise},c=function(e){return Boolean(e)?Object.keys(e):[]},s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l="Expected a function",f="__lodash_hash_undefined__",d=1/0,p="[object Function]",v="[object GeneratorFunction]",h="[object Symbol]",m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y=/^\w*$/,g=/^\./,_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g,E=/^\[object .+?Constructor\]$/,j="object"==r(s)&&s&&s.Object===Object&&s,w="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,O=j||w||Function("return this")();var A,S=Array.prototype,P=Function.prototype,x=Object.prototype,k=O["__core-js_shared__"],V=(A=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",F=P.toString,R=x.hasOwnProperty,T=x.toString,M=RegExp("^"+F.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=O.Symbol,N=S.splice,z=Q(O,"Map"),L=Q(Object,"create"),I=$?$.prototype:void 0,C=I?I.toString:void 0;function D(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}function G(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}function U(e){var r=-1,t=e?e.length:0;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}function B(e,r){for(var t,n,o=e.length;o--;)if((t=e[o][0])===(n=r)||t!=t&&n!=n)return o;return-1}function H(e,t){for(var n,o=0,i=(t=function(e,t){if(K(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return y.test(e)||!m.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:K(n=t)?n:W(n)).length;null!=e&&o<i;)e=e[X(t[o++])];return o&&o==i?e:void 0}function Z(e){return!(!Y(e)||(r=e,V&&V in r))&&(function(e){var r=Y(e)?T.call(e):"";return r==p||r==v}(e)||function(e){var r=!1;if(null!=e&&"function"!=typeof e.toString)try{r=!!(e+"")}catch(e){}return r}(e)?M:E).test(function(e){if(null!=e){try{return F.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var r}function q(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Q(e,r){var t=function(e,r){return null==e?void 0:e[r]}(e,r);return Z(t)?t:void 0}D.prototype.clear=function(){this.__data__=L?L(null):{}},D.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},D.prototype.get=function(e){var r=this.__data__;if(L){var t=r[e];return t===f?void 0:t}return R.call(r,e)?r[e]:void 0},D.prototype.has=function(e){var r=this.__data__;return L?void 0!==r[e]:R.call(r,e)},D.prototype.set=function(e,r){return this.__data__[e]=L&&void 0===r?f:r,this},G.prototype.clear=function(){this.__data__=[]},G.prototype.delete=function(e){var r=this.__data__,t=B(r,e);return!(t<0)&&(t==r.length-1?r.pop():N.call(r,t,1),!0)},G.prototype.get=function(e){var r=this.__data__,t=B(r,e);return t<0?void 0:r[t][1]},G.prototype.has=function(e){return B(this.__data__,e)>-1},G.prototype.set=function(e,r){var t=this.__data__,n=B(t,e);return n<0?t.push([e,r]):t[n][1]=r,this},U.prototype.clear=function(){this.__data__={hash:new D,map:new(z||G),string:new D}},U.prototype.delete=function(e){return q(this,e).delete(e)},U.prototype.get=function(e){return q(this,e).get(e)},U.prototype.has=function(e){return q(this,e).has(e)},U.prototype.set=function(e,r){return q(this,e).set(e,r),this};var W=J((function(e){var r;e=null==(r=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return C?C.call(e):"";var r=e+"";return"0"==r&&1/e==-d?"-0":r}(r);var t=[];return g.test(e)&&t.push(""),e.replace(_,(function(e,r,n,o){t.push(n?o.replace(b,"$1"):r||e)})),t}));function X(e){if("string"==typeof e||ee(e))return e;var r=e+"";return"0"==r&&1/e==-d?"-0":r}function J(e,r){if("function"!=typeof e||r&&"function"!=typeof r)throw new TypeError(l);var t=function t(){var n=arguments,o=r?r.apply(this,n):n[0],i=t.cache;if(i.has(o))return i.get(o);var u=e.apply(this,n);return t.cache=i.set(o,u),u};return t.cache=new(J.Cache||U),t}J.Cache=U;var K=Array.isArray;function Y(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function ee(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&T.call(e)==h}var re=function(e,r,t){var n=null==e?void 0:H(e,r);return void 0===n?t:n},te=function(){return{type:"",succeeded:!0,message:""}},ne=function(){return{succeeded:!0,recordErrors:{}}},oe=function(){return{succeeded:!0,fieldErrors:{},recordErrors:{}}},ie=function(e){return function(r){var t=e?e(r):{type:"",succeeded:!0,message:""};return a(t)?t:Promise.resolve(t)}},ue=function(e){return function(r){var t=e?e(r):{type:"",succeeded:!0,message:""};return a(t)?t:Promise.resolve(t)}},ae=function(e){return i(e)?{validator:ie(e),message:void 0,customArgs:void 0}:{validator:ie(i(e.validator)?e.validator:e.validator.validator),customArgs:e.customArgs,message:e.message}},ce=function(e){return Array.isArray(e)?e.map(ae):[]},se=function(e){var r=e instanceof Object?e:{},n=Object.entries(r).map((function(e){var r=t(e,2),n=r[0],o=r[1];return[n,ce(o)]}));return n.reduce((function(e,r){var n=t(r,2),o=n[0],i=n[1];return e[o]=i,e}),{})},le=function(e){return i(e)?{validator:ue(e),message:void 0}:{validator:ue(i(e.validator)?e.validator:e.validator.validator),message:e.message}},fe=function(e){return Array.isArray(e)?e.map(le):[]},de=function(e){var r=e instanceof Object?e:{},n=Object.entries(r).map((function(e){var r=t(e,2),n=r[0],o=r[1];return[n,fe(o)]}));return n.reduce((function(e,r){var n=t(r,2),o=n[0],i=n[1];return e[o]=i,e}),{})},pe=function(e,r,t,n){return e.map((function(e){return n(e,r,t)}))},ve=function(e){var r=e;return e&&!u(e.succeeded)||(console.error("form-validators: One of the record validator is returning a non expected value."),r={key:"",type:"",succeeded:!0,message:""}),r},he=function(e,r){return r.validator({values:e,message:r.message}).then(ve)},me=function(e,r){return o(r)?function(e,r){return r.reduce((function(r,t){return r.then((function(r){return r.succeeded?he(e,t):r}))}),he(e,r[0]))}(e,r):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},ye=function(e){var r=e;return e&&!u(e.succeeded)||(console.error("form-validators: One of the field validator is returning a non expected value."),r={key:"",type:"",succeeded:!0,message:""}),r},ge=function(e,r,t){return t.validator({value:e,values:r,customArgs:t.customArgs,message:t.message}).then(ye)},_e=function(e,r,t){return o(t)?function(e,r,t){return t.reduce((function(t,n){return t.then((function(t){return t.succeeded?ge(e,r,n):t}))}),ge(e,r,t[0]))}(e,r,t):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},be=function(e){return e.every((function(e){return e.succeeded}))},Ee=function(e){return e.reduce((function(e,r){var t=r.key,o=n(r,["key"]);return e[t]=Object.assign({},o),e}),{})},je=function(e){var r={succeeded:!0,recordErrors:{}};return o(e)&&(r.succeeded=be(e),r.recordErrors=Ee(e)),r},we=function(e,r){return!u(r)&&!u(r[e])},Oe=function(e,r,t,n){return we(e,n)?_e(r,t,n[e]).then((function(r){return r.key=e,r})).catch((function(r){var t="Validation Exception, field: ".concat(e);throw console.error(t),r})):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},Ae=function(e,r,t){return we(e,t)?me(r,t[e]).then((function(r){return r.key=e,r})).catch((function(r){var t="Validation Exception, record: ".concat(e);throw console.error(t),r})):Promise.resolve({key:"",type:"",succeeded:!0,message:""})},Se=function(e,r,n){var i=function(e,r,t,n){return e.map((function(e){return n(e,re(r,e,void 0),r,t)}))}(c(r),e,r,Oe),u=pe(c(n),e,n,Ae);return Promise.all(i).then((function(e){return Promise.all(u).then((function(r){return[e,r]}))})).then((function(e){var r=t(e,2);return function(e,r){var t={succeeded:!0,fieldErrors:{},recordErrors:{}};if(o(e)&&(t.succeeded=be(e),t.fieldErrors=Ee(e)),o(r)){var n=je(r);t.succeeded=t.succeeded&&n.succeeded,t.recordErrors=n.recordErrors}return t}(r[0],r[1])})).catch((function(e){throw console.error("Uncontrolled error validating records"),e}))},Pe=function e(t){var o=this;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.fieldSchema={},this.recordSchema={},this.setupValidationSchema=function(e){if(e&&"object"===r(e)){var t=e.record,n=e.field;n&&"object"===r(n)&&(o.fieldSchema=se(e.field)),t&&"object"===r(t)&&(o.recordSchema=de(e.record))}else console.error("ValidationSchema must be a valid object")},this.validateField=function(e,r,t){return Oe(e,r,t,o.fieldSchema).then((function(e){e.key;var r=n(e,["key"]);return Object.assign({},r)}))},this.validateRecord=function(e){return function(e,r){var t=pe(c(r),e,r,Ae);return Promise.all(t).then((function(e){return je(e)})).catch((function(e){throw console.error("Uncontrolled error validating records"),e}))}(e,o.recordSchema)},this.validateForm=function(e){return Se(e,o.fieldSchema,o.recordSchema)},this.updateValidationSchema=function(e){o.setupValidationSchema(e)},this.setupValidationSchema(t)},xe=function(e,r){return e?function(e,r){var t=function(e){return e.match(/{{[^{}][\w\.]*}}/g)}(e);return Array.isArray(t)?t.reduce((function(e,t){return e.replace(t,re(r,function(e){return e.replace(/[{}]/g,"")}(t),t))}),e):e}(e,r):""},ke="Please fill in this mandatory field.",Ve={trim:!0},Fe=function(e,r){return!!function(e){return null==e||""===e}(e)||r.test(e)},Re="Please enter a valid email address.",Te=/^(([^<>()\[\]\\.,;:\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,}))$/,Me="Please provide a valid format.",$e="FieldValidationError: pattern option for pattern validation is mandatory. Example: { pattern: /d+/ }.";function Ne(e){var r=e.pattern;if("boolean"==typeof r||null===r)throw new Error($e);return function(e){return e instanceof RegExp?e:new RegExp(e)}(r)}function ze(e,r){var t=null===e.length?NaN:Number(e.length);if(isNaN(t))throw new Error(r);return t}function Le(e,r,t){return"string"!=typeof e||t(e,r)}var Ie="The value provided does not fulfill min length",Ce='FieldValidationError: Parameter "length" for minLength in customArgs is mandatory and should be a valid number. Example: { length: 4 }.',De=function(e,r){return e.length>=r},Ge="The value provided does not fulfill max length",Ue='FieldValidationError: Parameter "length" for maxLength in customArgs is mandatory and should be a valid number. Example: { length: 4 }.',Be=function(e,r){return e.length<=r},He={required:Object.freeze({__proto__:null,setErrorMessage:function(e){return ke=e},validator:function(e){var r=e.value,t=e.customArgs,n=void 0===t?Ve:t,o=e.message,i=void 0===o?ke:o,u=function(e,r){return"string"==typeof e?function(e,r){return r?e.trim().length>0:e.length>0}(e,r):function(e){return null!=e}(e)}(r,Boolean(n.trim));return{succeeded:u,message:u?"":xe(i,n),type:"REQUIRED"}}}),email:Object.freeze({__proto__:null,setErrorMessage:function(e){return Re=e},validator:function(e){var r=e.value,t=e.message,n=void 0===t?Re:t,o=function(e){return Fe(e,Te)}(r);return{succeeded:o,message:o?"":n,type:"EMAIL"}}}),pattern:Object.freeze({__proto__:null,setErrorMessage:function(e){return Me=e},validator:function(e){if(!e.customArgs)throw new Error($e);var r=e.value,t=e.customArgs,n=void 0===t?null:t,o=e.message,i=void 0===o?Me:o,u=Ne(n),a=Fe(r,u);return{succeeded:a,message:a?"":xe(i,n),type:"PATTERN"}}}),minLength:Object.freeze({__proto__:null,setErrorMessage:function(e){return Ie=e},validator:function(e){if(!e.customArgs)throw new Error(Ce);var r=e.value,t=e.customArgs,n=void 0===t?null:t,o=e.message,i=void 0===o?Ie:o,u=Le(r,ze(n,Ce),De);return{succeeded:u,message:u?"":xe(i,n),type:"MIN_LENGTH"}}}),maxLength:Object.freeze({__proto__:null,setErrorMessage:function(e){return Ge=e},validator:function(e){if(!e.customArgs)throw new Error(Ue);var r=e.value,t=e.customArgs,n=void 0===t?null:t,o=e.message,i=void 0===o?Ge:o,u=Le(r,ze(n,Ue),Be);return{succeeded:u,message:u?"":xe(i,n),type:"MAX_LENGTH"}}})};e.FormValidation=Pe,e.Validators=He,e.createDefaultFormValidationResult=oe,e.createDefaultRecordValidationResult=ne,e.createDefaultValidationResult=te,e.createFormValidation=function(e){return new Pe(e)},e.parseMessageWithCustomArgs=xe,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@lemoncode/fonk", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Form schema validator library", | ||
@@ -63,3 +63,3 @@ "main": "dist/@lemoncode/fonk.cjs.js", | ||
"lint-staged": "^9.2.3", | ||
"np": "^5.0.3", | ||
"np": "^5.1.3", | ||
"prettier": "^1.19.1", | ||
@@ -88,3 +88,7 @@ "pretty-quick": "^1.11.1", | ||
] | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/", | ||
"access": "public" | ||
} | ||
} |
@@ -38,4 +38,4 @@ import { ValidationResult } from './result.model'; | ||
validator: | ||
| FieldValidationFunctionSyncAsync | ||
| { validator: FieldValidationFunctionSyncAsync }; | ||
| FieldValidationFunctionSyncAsync | ||
| { validator: FieldValidationFunctionSyncAsync }; | ||
customArgs?: any; | ||
@@ -42,0 +42,0 @@ message?: string | string[]; |
@@ -0,0 +0,0 @@ import { ValidationResult } from './result.model'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183788
2
80
4618