2 Object.defineProperty(exports, "__esModule", { value: true });
3 const codegen_1 = require("../../compile/codegen");
5 message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,
6 params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,
15 const { gen, data, schemaCode, it } = cxt;
16 // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
17 const prec = it.opts.multipleOfPrecision;
18 const res = gen.let("res");
20 ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
21 : (0, codegen_1._) `${res} !== parseInt(${res})`;
22 cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
25 exports.default = def;
26 //# sourceMappingURL=multipleOf.js.map