_typeError : function validate(_ref,cb){let{value:value,path:path="",label:label,options:options,originalValue:originalValue,sync:sync}=_ref,rest=function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}(_ref,["value","path","label","options","originalValue","sync"]);const{name:name,test:test,params:params,message:message}=config;let{parent:parent,context:context}=options;function resolve(item){return Reference_Reference.isRef(item)?item.getValue(value,parent,context):item}function createError(overrides={}){const nextParams=mapValues_default()(createValidation_extends({value:value,originalValue:originalValue,label:label,path:overrides.path||path},params,overrides.params),resolve),error=new ValidationError_ValidationError(ValidationError_ValidationError.formatError(overrides.message||message,nextParams),value,nextParams.path,overrides.type||name);return error.params=nextParams,error}let result,ctx=createValidation_extends({path:path,parent:parent,type:name,createError:createError,resolve:resolve,options:options,originalValue:originalValue},rest);if(sync){try{var _ref2;if(result=test.call(ctx,value,ctx),"function"==typeof(null==(_ref2=result)?void 0:_ref2.then))throw new Error(`Validation test of type: "${ctx.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(err){return void cb(err)}ValidationError_ValidationError.isError(result)?cb(result):result?cb(null,result):cb(createError())}else try{Promise.resolve(test.call(ctx,value,ctx)).then((validOrError=>{ValidationError_ValidationError.isError(validOrError)?cb(validOrError):validOrError?cb(null,validOrError):cb(createError())}))}catch(err){cb(err)}}