PIat
PIat
Explore posts from servers
PPrisma
Created by PIat on 1/2/2025 in #help-and-questions
Using a JSON field as an id
Alright! Thank you a lot! Sounds like a plan!
4 replies
DDeno
Created by devin on 12/15/2024 in #help
fresh + workspace
I am trying to do the same but with React. I also found that copying the configuration to root helps, but importing anything like useState doesn't work
3 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
Pretty readable too..?
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
It would be the technically correct way
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
Thank you too 😊
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
Should I file it?
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
Would look great, but it's not critical right now. It'd just be sugar. When handling uploads, you'd also check the MIME type and probably the actual contents, so at that point you'd create a narrow anyways
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
I really like having numbers be written in natural language. Had my share of 5 * 60 * 1000
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
If 1s it'll convert to 1000
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
When you insert 1000 it will convert to 1s
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
ms only returns string or number
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
Actually now that I'm thinking about it, only Arktype knows what the return value from the string would be 😁
41 replies
Aarktype
Created by zx on 10/9/2024 in #questions
File type
I would definitely be using a utility function (similar to ms: https://www.npmjs.com/package/ms) to convert MB to bytes and using as const
type({
myFile: `File<${convertToBytes('30mb') as const}`
})
type({
myFile: `File<${convertToBytes('30mb') as const}`
})
Adding MB and/or KB would be a lot smoother DX
41 replies
Aarktype
Created by PIat on 10/9/2024 in #questions
Type definitions must be strings or objects (was undefined)
So it's not an Arktype error
18 replies
Aarktype
Created by PIat on 10/9/2024 in #questions
Type definitions must be strings or objects (was undefined)
I think I found it: With a model a utility function throws: TypeError: Cannot convert undefined or null to object
export function fromEnum<T extends object>(arg: T) {
return ['===', ...Object.values(arg)] as ['===', ...Array<T[keyof T]>]
}
export function fromEnum<T extends object>(arg: T) {
return ['===', ...Object.values(arg)] as ['===', ...Array<T[keyof T]>]
}
18 replies
Aarktype
Created by PIat on 10/9/2024 in #questions
Type definitions must be strings or objects (was undefined)
It's a runtime error
18 replies
Aarktype
Created by PIat on 10/9/2024 in #questions
Type definitions must be strings or objects (was undefined)
What about
type({})
type({})
Would this crash?
18 replies
Aarktype
Created by PIat on 10/9/2024 in #questions
Type definitions must be strings or objects (was undefined)
I am not sure what causes it, I will go through the types now and hopefully find it
18 replies
Aarktype
Created by PIat on 10/9/2024 in #questions
Type definitions must be strings or objects (was undefined)
During instantiation or assertion?
18 replies
Aarktype
Created by PIat on 10/8/2024 in #questions
Conform to an existing type
Will have this in the back of my mind for the future, thank you 😊
29 replies