aabad_ankit
Aarktype
•Created by SynthLuvr on 6/12/2024 in #questions
Can you create types with dynamic literals?
Thank You. This is what I was looking for.
44 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
using
"arktype": "^2.0.0-rc.5",
25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
Great, I will give this a try
25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
Are you saying that using
map
it is possible to remove all the default from all the properties(nested or otherwise) (I dont' know the properties name which can have default)25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
Just a test example so I do need to validate a complete object without applying default values so
.withoutOptionalAndDefaultMeta
should solve my problem.25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
Any way to circumvent default values
Gives me
{ email: '[email protected]', age: 10 }
dont want it to add age to it25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
Thank you so much for the quick response
25 replies
Aarktype
•Created by aabad_ankit on 10/3/2024 in #questions
Partial Application of the validator
Awesome. For my current use case
get
should be sufficient.25 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
Thank you so much for all the help
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
@ArkDavid You were suggesting to use narrow, can I do it on union and solve my problem
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
a code sample will be super useful
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
but delete on undeclared key will work on union right once you have built in discrimination based on key presence
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
This prints
age must be a number (was missing) or city must be a string (was missing)
. I just want the error msg to be age must be a number (was missing)
to do that I am currently doing something like this
so I wanted to know if there is more idiomatic way to do this66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
@ArkDavid @Dimava the Monoreaper What will be the most idiomatic way to do the validation for such union types to get correct error msg. Do I need to check for the properties and do validation by creating a validator map
This is getting verbose.
I am giving example of just one field but my inputs are larger and I have 5 different types of input. If I could have done union then I would have declared on deepUndeclaredkey("delete") on just the union as well as the pipe on the union
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
Oh Yeah, Understood 👍
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
I am getting
name must be a string (was missing) or city must be a string (was missing)
for both the code snippets below.
and
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
@ArkDavid How can I get better error msg for this
prints "name must be a string (was missing) or city must be a string (was missing)"
since age is already there shouldn't it just say "name must be a string (was missing) "
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
docs will certainly help.
66 replies
Aarktype
•Created by aabad_ankit on 9/4/2024 in #questions
Can I add a default value to a type if everything other satisfies in a union type
I need to learn a lot 🙂 . This library is just awesome.
66 replies