source: imaps-frontend/node_modules/ajv/lib/dot/multipleOf.jst

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 644 bytes
Line 
1{{# def.definitions }}
2{{# def.errors }}
3{{# def.setupKeyword }}
4{{# def.$data }}
5
6{{# def.numberKeyword }}
7
8var division{{=$lvl}};
9if ({{?$isData}}
10 {{=$schemaValue}} !== undefined && (
11 typeof {{=$schemaValue}} != 'number' ||
12 {{?}}
13 (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}},
14 {{? it.opts.multipleOfPrecision }}
15 Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}}
16 {{??}}
17 division{{=$lvl}} !== parseInt(division{{=$lvl}})
18 {{?}}
19 )
20 {{?$isData}} ) {{?}} ) {
21 {{# def.error:'multipleOf' }}
22} {{? $breakOnError }} else { {{?}}
Note: See TracBrowser for help on using the repository browser.