{{ var $schema = it.schema[$rule.keyword] , $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it) , $ruleErrs = $ruleValidate.code + '.errors' , $schemaPath = it.schemaPath + '.' + $rule.keyword , $errSchemaPath = it.errSchemaPath + '/' + $rule.keyword , $errs = 'errs' + $lvl , $i = 'i' + $lvl , $ruleErr = 'ruleErr' + $lvl , $rDef = $rule.definition , $asyncKeyword = $rDef.async , $inline = $rDef.inline , $macro = $rDef.macro; if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); }} {{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} var {{=$errs}} = errors; var valid{{=$lvl}}; {{## def.callRuleValidate: {{=$ruleValidate.code}}.call( {{? it.opts.passContext }}this{{??}}self{{?}} {{ var $validateArgs = $ruleValidate.validate.length; }} {{? $rDef.compile || $rDef.schema === false }} , {{=$data}} {{??}} , validate.schema{{=$schemaPath}} , {{=$data}} , validate.schema{{=it.schemaPath}} {{?}} , {{# def.dataPath }} {{# def.passParentData }} ) #}} {{## def.ruleValidationResult: {{? $inline }} {{? $rDef.statements }} valid{{=$lvl}} {{??}} ({{= $ruleValidate.validate }}) {{?}} {{?? $macro }} valid{{=$it.level}} {{??}} {{? $asyncKeyword }} {{? $rDef.errors === false }} ({{=it.yieldAwait}}{{= def_callRuleValidate }}) {{??}} valid{{=$lvl}} {{?}} {{??}} {{= def_callRuleValidate }} {{?}} {{?}} #}} {{## def.extendErrors:_inline: for (var {{=$i}}={{=$errs}}; {{=$i}}