POP icon indicating copy to clipboard operation
POP copied to clipboard

type check properties

Open Pacman99 opened this issue 3 years ago • 2 comments
trafficstars

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 avatar May 27 '22 08:05 Pacman99

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

blaggacao avatar May 27 '22 13:05 blaggacao

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.

Pacman99 avatar May 27 '22 18:05 Pacman99