Gabriel Silva
Gabriel Silva
Explore posts from servers
Aarktype
Created by Gabriel Silva on 5/22/2025 in #questions
Help with Generic infered type
https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%253B%250A%250Aexport%2520type%2520RectItem%2520%253D%2520typeof%2520t.Rect.infer%253B%250A%250Aconst%2520%2524%2520%253D%2520type.scope%28%257B%250A%2520%2520%2520%2520Item%253A%2520%2522Rect%2522%252C%250A%2520%2520%2520%2520%2522Prop%253Ct%2520extends%2520string%2520%257C%2520number%2520%257C%2520boolean%253E%2522%253A%2520%255B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522t%2520%257C%2520null%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522%253D%253E%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%28prop%29%2520%253D%253E%2520prop%2520%253F%253F%2520undefined%252C%250A%2520%2520%2520%2520%255D%252C%250A%2520%2520%2520%2520SharedProps%253A%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520id%253A%2520%2522string%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520artboardId%253A%2520%2522string%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520parentId%253A%2520%2522string%2520%257C%2520null%2520%253D%2520null%2522%252C%250A%2520%2520%2520%2520%257D%252C%250A%2520%2520%2520%2520Rect%253A%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522...%2522%253A%2520%2522SharedProps%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520name%253A%2520%2522%27rect%27%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520fill%253A%2520%2522Prop%253Cstring%253E%2522%252C%250A%2520%2520%2520%2520%257D%252C%250A%257D%29%253B%250A%250Aexport%2520const%2520t%2520%253D%2520%2524.export%28%29%253B%250A RectItem is infering prop as:
{ fill: string | number | boolean | undefined; }
{ fill: string | number | boolean | undefined; }
but i want it to be:
{ fill: string | undefined; }
{ fill: string | undefined; }
1 replies
Aarktype
Created by Gabriel Silva on 6/11/2023 in #questions
Signup form validation
I'm building a sign up form that looks like this:
const schema = type({
email: 'email',
password: 'string>1',
confirmPassowrd: 'string'
})
const schema = type({
email: 'email',
password: 'string>1',
confirmPassowrd: 'string'
})
How can I validate the confirmPassword field and make sure it is equal "===" to the password field? SOLUTION: https://discord.com/channels/957797212103016458/1117525551079501917/1117532686299435038
43 replies