Giulio Canti
Giulio Canti
@ForbesLindesay thanks for this PR. > This change is backwards compatible Actually this is a breaking change, the following example will break ```ts // v----------v--------explicit type annotation const T =...
You can use a "standard" `pick` function ```ts declare function pick(o: O, keys: Array): Pick const BarT = t.type(pick(FooT.props, ['a'])) ```
> is io-ts going to provide an implementation at some point? @VanTanev No, I don't think so
> How about adding it to the non-core package io-ts-types? @ivawzh I'm not against that, however if the solution is not implementable using the new experimental modules, it's not going...
You could use `imap` ```ts import { pipe, identity } from 'fp-ts/function' const c: codec.Codec = pipe( innn, codec.imap(({ folder }) => ({ folder: folder ?? false }), identity) )...
> Either make t.keyof() accept only object with string keys @flegall that was my intention when I added the constraint `{ [key: string]: unknown }` here https://github.com/gcanti/io-ts/blob/5bce4fc5c7c5a9fc1ec3d2619f1302e05fc294f7/src/index.ts#L585 but looks like...
Sure, thank you!
Yes, alas TypeScript infers a union of numbers so there's a mismatch
> Is there any simplification possible? @kpritam I would define a decoder for the raw input (I'm guessing): ```ts const decoder = t.partial({ IntKey: t.type({ keyName: t.string, values: t.array(t.number) }),...
I see, but what I meant is that without the schema of the raw input is hard to say something and help you out. A single example ```ts // input...