Schmime
Explore posts from serversAarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Naw Im paying you, I insist
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
@ssalbdivad GIVE @TizzySaurus A RAISE PLEASE
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
YAY THANK YOU SO MUCH I SPENT SO MUCH TIME ON THIS LOL
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
AHHHHHH I THINK ITS ALL WORKING
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Ill test whatever you come up when I get home. Btw I insist on paying you lol
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
I have to leave my computer to go, I appreciate your help so much, can you DM me the best way to pay you?
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
So this is soooo close, just I need to do the === "" check after the trim is applied
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Check has to be after trim
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Example usecase is in a frontned form if a feild is empty itll send an empty string, but id want to store as null in database
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Yes exactly
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Sorry I changed "string.email" to just "string" as a test
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
THANK YOU SO MUCH!!!! I think we are super close, last test case should be r2 should return { email: null }, right now its throwing an error
const test = type({ email: nonEmptyStringOrNull("string") });
const r1 = test.from({});
const r2 = test.from({ email: "" });
const r3 = test.from({ email: " [email protected] " });
console.log(r1); // {email: null}
console.log(r2); // TraversalError: email must be an email address (was "hi")
console.log(r3); // {email: "[email protected]"}
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Module '"arktype"' has no exported member 'Out'.
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
👀👀👀👀
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
That looks amazing
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Error
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
But how would I do nonemptystringornull("string.uuid") for example? I think that's why David recommended a generic
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Sorry friend I am new to Arktype, the generic part was so I could pass in string or string subtypes like email or uuid
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Correct, it would be nice if it handled the Arktype string types like email
124 replies
Aarktype
•Created by Schmime on 3/1/2025 in #questions
Is there a better way to write this?
Hmmmmm I swear it was working.... Not sure what happened.. maybe I'm imagining things.
Basically I pay you if I can get some function that supports strings and literals, if the key is missing or empty or empty after trimming I want the value set to null
124 replies