BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / ajv / lib / dot / multipleOf.jst

multipleOf.jst

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
multipleOf.jst 618 B Download Raw
1{{# def.definitions }}
2{{# def.errors }}
3{{# def.setupKeyword }}
4{{# def.$data }}
5
6var division{{=$lvl}};
7if ({{?$isData}}
8 {{=$schemaValue}} !== undefined && (
9 typeof {{=$schemaValue}} != 'number' ||
10 {{?}}
11 (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}},
12 {{? it.opts.multipleOfPrecision }}
13 Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}}
14 {{??}}
15 division{{=$lvl}} !== parseInt(division{{=$lvl}})
16 {{?}}
17 )
18 {{?$isData}} ) {{?}} ) {
19 {{# def.error:'multipleOf' }}
20} {{? $breakOnError }} else { {{?}}