Sʜɪᴍᴜʀᴀ Yū
Sʜɪᴍᴜʀᴀ Yū
Got it, [here](https://github.com/ForbesLindesay/funtypes/pull/17)'s that. It's excellent effort, but deprecating `check` in favor of `parse` makes me feel a bit pointless, and I don't understand why `ParsedValue` is taking duplicate logic...
Let's compare, [`funtypes` looks like this](https://github.com/ForbesLindesay/funtypes/pull/17#issuecomment-689255509): > ```ts > const TrimmedString = ParsedValue(String, { > name: 'TrimmedString', > parse(value) { > return { success: true, value: value.trim() }; > },...
I couldn't get the point of your comment. Apparently your code has no "transform", so it does not work the same way as mine. What I tried to illustrate by...
The most succinct way to achieve this is `Intersect`. ```ts const partialDto = dto.asPartial().And(t.Record({ id: String })); ``` But this result in a hard-to-read static type such as: ```ts {...
Thanks I really appreciate this, but changing the failcode is a breaking change. Let me postpone merging this until the next major version. P.S. I'm *not* saying that we shouldn't...
@johngeorgewright Thanks rebasing this, but basically I don't want to require PR authors to do it by themselves. I'm working on other tasks, and I believe you will feel it...
Thanks, this kind of use case is exactly what I've been thinking recently. First of all, your examples are a bit wrong as it's not wrapped within `Record()`. The correct...
In `io-ts` it seems that TS emits an error on the signature of the `encode` method. I think this is caused by incompatibility of the parameter types, since parameter types...
> So if I understood correctly, this works "by chance" on `io-ts` Yeah, I believe it wouldn't be something intended. > Assuming the hacky `_phantom` is not an option, are...
There's more proper way around, you can use [`Guard` runtype](https://github.com/pelotom/runtypes/tree/v6.3.0#constraint-checking) like this: ```ts const x = Contract( Record({}), Guard((x): x is 3 => true), ).enforce(arg => 3); ``` But I...