@colisweb/rescript-toolkit 4.1.0 → 4.1.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -95,6 +95,16 @@ let requiredPosFloat = (intl, value) => {
95
95
  }
96
96
  }
97
97
 
98
+ let requiredStrictPosFloat = (intl, value) => {
99
+ switch value {
100
+ | "" => Some(Intl.formatMessage(intl, Msg.requiredValue))
101
+ | value
102
+ if !Toolkit__Utils_Regex.Test.isPositiveIntOrFloat(value) || value->Float.fromString === Some(0.) =>
103
+ Some(Intl.formatMessage(intl, Msg.requiredPosIntOrFloat))
104
+ | _ => None
105
+ }
106
+ }
107
+
98
108
  let requiredFloat = (intl, value) => {
99
109
  switch value->Js.String2.split("-") {
100
110
  | _ if value === "" => Some(Intl.formatMessage(intl, Msg.requiredValue))