shelving 1.159.3 → 1.159.4
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.
- package/package.json +1 -1
- package/schema/NumberSchema.js +2 -2
package/package.json
CHANGED
package/schema/NumberSchema.js
CHANGED
|
@@ -19,10 +19,10 @@ export class NumberSchema extends Schema {
|
|
|
19
19
|
if (typeof optionalNumber !== "number")
|
|
20
20
|
throw new ValueFeedback("Must be number", unsafeValue);
|
|
21
21
|
const roundedNumber = typeof this.step === "number" ? roundStep(optionalNumber, this.step) : optionalNumber;
|
|
22
|
+
if (roundedNumber < this.min)
|
|
23
|
+
throw new ValueFeedback(!optionalNumber ? "Required" : `Minimum ${formatNumber(this.min)}`, roundedNumber);
|
|
22
24
|
if (roundedNumber > this.max)
|
|
23
25
|
throw new ValueFeedback(`Maximum ${formatNumber(this.max)}`, roundedNumber);
|
|
24
|
-
if (roundedNumber < this.min)
|
|
25
|
-
throw new ValueFeedback(`Minimum ${formatNumber(this.min)}`, roundedNumber);
|
|
26
26
|
return roundedNumber;
|
|
27
27
|
}
|
|
28
28
|
}
|