About using a generic pipe
Hello everyone,
I am writing a schema in which one of the fields requiredness can be played with. I've come up with this type
It does the job perfectly well. Now, if I want to use it for a schema, where the value should be sent if the value is null, I can use something like this:
But now, let's say I want to reuse this kind of logic in multiple other schemas. I thought about creating a pipe generator so that only the key needs to be set. Something like this:
that would help by rewriting
But then, the types resulting from the schema seem off. I guess this is more a TypeScript-related question than a Arktype one
I am writing a schema in which one of the fields requiredness can be played with. I've come up with this type
It does the job perfectly well. Now, if I want to use it for a schema, where the value should be sent if the value is null, I can use something like this:
But now, let's say I want to reuse this kind of logic in multiple other schemas. I thought about creating a pipe generator so that only the key needs to be set. Something like this:
that would help by rewriting
Profile as But then, the types resulting from the schema seem off. I guess this is more a TypeScript-related question than a Arktype one