@colisweb/rescript-toolkit 4.18.0 → 4.18.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.
package/package.json
CHANGED
|
@@ -109,8 +109,19 @@ module MakeStringOrInt = () => {
|
|
|
109
109
|
let deleteKey: (t<'a>, key) => t<'a>
|
|
110
110
|
}
|
|
111
111
|
} = {
|
|
112
|
+
let encoder: Decco.encoder<string> = id => id->Decco.stringToJson
|
|
113
|
+
|
|
114
|
+
let decoder: Decco.decoder<string> = json =>
|
|
115
|
+
switch (Decco.stringFromJson(json), Decco.intFromJson(json)) {
|
|
116
|
+
| (Ok(v), _) => Ok(v)
|
|
117
|
+
| (_, Ok(v)) => Ok(v->Int.toString)
|
|
118
|
+
| (Error(err), _) => Error(err)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let codec: Decco.codec<string> = (encoder, decoder)
|
|
122
|
+
|
|
112
123
|
@decco
|
|
113
|
-
type t = string
|
|
124
|
+
type t = @decco.codec(codec) string
|
|
114
125
|
module Dict = {
|
|
115
126
|
include Js.Dict
|
|
116
127
|
|
package/src/vendors/Lodash.res
CHANGED