You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using zod, but like the idea of using types only for my project.
So far every thing would work, but I would need to be able to mark properties, so I can identify them at runtime.
My specific usecase is that I have a schema for a db-event in event-sourcing, but want to mark specific fields as PII (Personal Identifiable Data) to be able to store these fields in another store and only the reference to them to the event-stream.
For that to be possible I need the information at runtime.
I currently see two possible solutions:
While checking, alter the checked object and annotate the actual properties.
Add an additional function to typia that returns the paths of tags.
While 1 would be optimal in usage, I doubt that this is a good idea, since a is check should not alter anything and be pure.
The second approach is a bit more work, and has the challenge of union and array types, but would be pure and does not alter anything.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently using zod, but like the idea of using types only for my project.
So far every thing would work, but I would need to be able to mark properties, so I can identify them at runtime.
My specific usecase is that I have a schema for a db-event in event-sourcing, but want to mark specific fields as PII (Personal Identifiable Data) to be able to store these fields in another store and only the reference to them to the event-stream.
For that to be possible I need the information at runtime.
I currently see two possible solutions:
While 1 would be optimal in usage, I doubt that this is a good idea, since a
ischeck should not alter anything and be pure.The second approach is a bit more work, and has the challenge of union and array types, but would be pure and does not alter anything.
A possible api:
What is your opinion on that?
Beta Was this translation helpful? Give feedback.
All reactions