funtypes icon indicating copy to clipboard operation
funtypes copied to clipboard

Runtime validation for static types

Results 26 funtypes issues
Sort by recently updated
recently updated
newest added

The changes from #17 (specifically, the placeholder-based parsing machinery introduced in 6e58e53) breaks a _bunch_ of stuff. - Placeholders don't preserve the prototype chain, so `instanceof` breaks - Placeholders are...

documentation

![Screenshot 2022-10-08 at 01 08 06](https://user-images.githubusercontent.com/44158456/194673877-fa8be4bc-81b1-4142-ad15-0263dae8f4a7.png) I ran this complete example in Quokka to show the output inline.

documentation

#17 essentially transformed funtypes into codecs, able to both decode/parse and encode/serialise values. The existing `Static` type function allows us to derive the decoded/parsed type from a funtype. It would...

enhancement

```typescript const someSchema = FT.Record({...}) const parsedObject = someSchema.parse(...) console.log(parsedObject.toString) // prints undefined ``` That's quite the unexpected behavior!

documentation

The behaviour of `Intersect` isn't always very intuitive when it comes to objects. The behaviour people want is often much closer to "spread". We should implement something similar to Zod's...

enhancement

It would be useful to have a way to get a copy of an object with only selected fields or with some fields excluded. See https://github.com/vriad/zod#pick-and-omit for inspiration. Proposed API:...

enhancement
Released but undocumented

There is currently no way to disallow additional properties on records. The closest you could get would be to Intersect the Record with a Dictionary that specifies the allowed fields....

enhancement
Released but undocumented

Currently you can create an object with optional properties by using an Intersection of a `Record` and a `Partial`. This has a number of issues though: 1. It's not very...

enhancement

I have purchased https://funtypes.dev with the intentention of having a small website for nicely formatted documentation of funtypes and related projects. It needs setting up with docusaurus 2 in this...

documentation

As someone coming from runtypes looking for a solution to https://github.com/pelotom/runtypes/issues/56, I found funtypes but it is unclear to me what exactly I'm getting along with a solution to that...