z-schema 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6545,7 +6545,9 @@ var JsonValidators = {
6545
6545
  return;
6546
6546
  }
6547
6547
 
6548
- if (Utils.whatIs(json / schema.multipleOf) !== "integer") {
6548
+ var stringMultipleOf = String(schema.multipleOf);
6549
+ var scale = Math.pow(10, stringMultipleOf.length - stringMultipleOf.indexOf(".") - 1);
6550
+ if (Utils.whatIs((json * scale) / (schema.multipleOf * scale)) !== "integer") {
6549
6551
  report.addError("MULTIPLE_OF", [json, schema.multipleOf], null, schema);
6550
6552
  }
6551
6553
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "z-schema",
3
- "version": "4.2.1",
3
+ "version": "4.2.2",
4
4
  "engines": {
5
5
  "node": ">=6.0.0"
6
6
  },
@@ -21,7 +21,9 @@ var JsonValidators = {
21
21
  return;
22
22
  }
23
23
 
24
- if (Utils.whatIs(json / schema.multipleOf) !== "integer") {
24
+ var stringMultipleOf = String(schema.multipleOf);
25
+ var scale = Math.pow(10, stringMultipleOf.length - stringMultipleOf.indexOf(".") - 1);
26
+ if (Utils.whatIs((json * scale) / (schema.multipleOf * scale)) !== "integer") {
25
27
  report.addError("MULTIPLE_OF", [json, schema.multipleOf], null, schema);
26
28
  }
27
29
  },