Open colin-han opened 1 year ago
This looks good!
What are the blockers for integration?
@cchepelov There still has some UT is not passed. And a newer version of TypeScript is required. I guess that is why this PR is not merged into master.
I'm sorry I have not enough time and skill to fix all issue. If the feature is required for you, you can use another library I published to NPM ( io-ts-with-optional ) as a workaround.
Thank you @colin-han!
I'll see if I can get away with no optionals for the time being. It looks like io-ts' 3.0 branch is moving a bit, too. Afraid I'm lacking time/skill as well to help with a fix, although I'll sure be happy if that happens
It looks like io-ts' 3.0 branch is moving a bit, too.
@cchepelov the active development of the next major iteration of io-ts (and more generally of the fp-ts ecosystem) is happening here
@gcanti It looks like the new Schema system is powerful. Do you have consider to support optional syntax like mine? The current optional syntax (C.struct({ a: C.string, b: C.number }, { c: C.boolean })
) is a little less readable.
@colin-han just landed in the development branch
Based on the PR #654 , I'm trying to make a more readable solution to support optional properties of TypeScript.
I define a new keyword
t.optional
to annotate a properties is optional. The above declaration will generated type likes following:I borrow all UT from the PR #654 . Thanks to the author @mjburghoffer, your UT help me so many.
BTW, I don't known why I cannot pass all test (prettier and eslint) on my local environment. If it's a problem to merge this PR. let me known, I will take more research for it.