Dimava
Dimava
Aarktype
Created by Tehrin on 4/13/2025 in #questions
.narrow(...).in doesn't return the original type
.in/.out are for the morph types They keep narrows
4 replies
Aarktype
Created by El Barto on 4/4/2025 in #questions
Advices for this use case?
If you don't care you may just unknown it
8 replies
Aarktype
Created by El Barto on 4/4/2025 in #questions
Advices for this use case?
I don't remember if there is scope().scope() but ik for sure there's scope().type()
8 replies
Aarktype
Created by El Barto on 4/4/2025 in #questions
Advices for this use case?
I don't think wrapper is useful because it's too simple Why not just : { data: 'navitem[]' ?
8 replies
Aarktype
Created by El Barto on 4/4/2025 in #questions
Advices for this use case?
Make depth 0|1|2 instead maybe
8 replies
Aarktype
Created by jacksteamdev on 3/28/2025 in #questions
Zod Interop?
AI needs toJsonSchema because it needs that for schema-aware generation Do yall plan to add it to standard schema?
6 replies
Aarktype
Created by Enet on 4/2/2025 in #questions
Type script Error
Or Google's one, or Copilot
7 replies
Aarktype
Created by Enet on 4/2/2025 in #questions
Type script Error
I don't think we can because it's not related to ArkType Please install https://marketplace.visualstudio.com/items?itemName=augment.vscode-augment and ask it how to fix it
7 replies
Aarktype
Created by Enet on 4/2/2025 in #questions
Type script Error
Screenshot?
7 replies
Aarktype
Created by guersam on 3/19/2025 in #questions
Inferring generic types
It is a language enough to run Doom in it
36 replies
Aarktype
Created by guersam on 3/19/2025 in #questions
Inferring generic types
Hmm wait you need the types Lemme think
36 replies
Aarktype
Created by guersam on 3/19/2025 in #questions
Inferring generic types
RTFM HKT Generics https://arktype.io/docs/generics#hkt Its advanced TS stuff so if you have any more questions you are welcome to ask
36 replies
Aarktype
Created by schmime on 3/16/2025 in #questions
Generic loses literal
import { generic, Hkt } from "arktype"

const NonEmptyStringOrNull = generic(["T", "string"])(
args => type(args.T, '|', 'null | undefined').pipe(s => !s ? null : s),
class NonEmptyStringOrNullHkt extends Hkt<[string]> {
declare body: (In: this[0] | null | undefined) => this[0] | null
}
)
import { generic, Hkt } from "arktype"

const NonEmptyStringOrNull = generic(["T", "string"])(
args => type(args.T, '|', 'null | undefined').pipe(s => !s ? null : s),
class NonEmptyStringOrNullHkt extends Hkt<[string]> {
declare body: (In: this[0] | null | undefined) => this[0] | null
}
)
3 replies
Aarktype
Created by L0xus on 3/16/2025 in #questions
Narrow type based on another property's value
Generic is also possible you just need the hkt one
10 replies
Aarktype
Created by L0xus on 3/16/2025 in #questions
Narrow type based on another property's value
type({
type: "'string'",
value: '"string"
}).or({
type: "'Color'",
value: "string.hex"
})
type({
type: "'string'",
value: '"string"
}).or({
type: "'Color'",
value: "string.hex"
})
10 replies
Aarktype
Created by Tom on 2/13/2025 in #questions
can `optional()` be used with a thunk?
You may use generics
6 replies
Aarktype
Created by DiamondDragon on 1/18/2025 in #questions
exact length "string = 2"
no ==
10 replies
Aarktype
Created by DiamondDragon on 1/18/2025 in #questions
exact length "string = 2"
import { type } from 'arktype'

type("string == 123")
import { type } from 'arktype'

type("string == 123")
10 replies
Aarktype
Created by DiamondDragon on 1/18/2025 in #questions
exact length "string = 2"
So It was there all the time
10 replies
Aarktype
Created by DiamondDragon on 1/18/2025 in #questions
exact length "string = 2"
Maybe it's there and we've just not tried it lol
10 replies