Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type check properties #4

Open
Pacman99 opened this issue May 27, 2022 · 2 comments
Open

type check properties #4

Pacman99 opened this issue May 27, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Pacman99
Copy link
Member

Best idea I've come up with to do this is to have yants export a function that generates a type checking pop. This pop will simply have an extension that does nothing but type check a series of values. If there are any problems, yants check functions will throw errors, otherwise the extension can just return an empty attrset. This could be implemented in yants itself.

@Pacman99 Pacman99 added the enhancement New feature or request label May 27, 2022
@blaggacao
Copy link
Collaborator

yants already has nestable struct validation, is that what we'd be looking at?

@Pacman99
Copy link
Member Author

Yeah exactly, I don't think pop or yants really has to be changed for this. You can do this manually already by creating a pop that's extension type checks super and just returns back everything as the same. Then that type-checking pop can be a super for another pop where you want attributes type checked.

We can make a convenience function to create such a pop by passing it a yants struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants