3 {{# def.setupKeyword }}
7 var $isMax = $keyword == 'maximum'
8 , $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum'
9 , $schemaExcl = it.schema[$exclusiveKeyword]
10 , $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data
11 , $op = $isMax ? '<' : '>'
12 , $notOp = $isMax ? '>' : '<';
17 var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr)
18 , $exclusive = 'exclusive' + $lvl
19 , $opExpr = 'op' + $lvl
20 , $opStr = '\' + ' + $opExpr + ' + \'';
22 var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}};
23 {{ $schemaValueExcl = 'schemaExcl' + $lvl; }}
25 var exclusive{{=$lvl}};
26 if (typeof {{=$schemaValueExcl}} != 'boolean' && typeof {{=$schemaValueExcl}} != 'undefined') {
27 {{ var $errorKeyword = $exclusiveKeyword; }}
28 {{# def.error:'_exclusiveLimit' }}
29 } else if({{# def.$dataNotType:'number' }}
30 ((exclusive{{=$lvl}} = {{=$schemaValueExcl}} === true)
31 ? {{=$data}} {{=$notOp}}= {{=$schemaValue}}
32 : {{=$data}} {{=$notOp}} {{=$schemaValue}})
33 || {{=$data}} !== {{=$data}}) {
34 var op{{=$lvl}} = exclusive{{=$lvl}} ? '{{=$op}}' : '{{=$op}}=';
37 var $exclusive = $schemaExcl === true
38 , $opStr = $op; /*used in error*/
39 if (!$exclusive) $opStr += '=';
40 var $opExpr = '\'' + $opStr + '\''; /*used in error*/
43 if ({{# def.$dataNotType:'number' }}
44 {{=$data}} {{=$notOp}}{{?$exclusive}}={{?}} {{=$schemaValue}}
45 || {{=$data}} !== {{=$data}}) {
47 {{ var $errorKeyword = $keyword; }}
48 {{# def.error:'_limit' }}
49 } {{? $breakOnError }} else { {{?}}