Dimava
Dimava
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
Aarktype
Created by Nicolas on 1/19/2025 in #questions
Extract schema inside an array
.json iirc
11 replies
Aarktype
Created by Nicolas on 1/19/2025 in #questions
Extract schema inside an array
Not toJsonSchema toJsonInternalRepresentation
11 replies
Aarktype
Created by Nicolas on 1/19/2025 in #questions
Extract schema inside an array
Re: OpenAPI 1. There is .json() that returns sorta schema you may want it 2. Lurk this server you're not the first to openapi
11 replies
Aarktype
Created by Nicolas on 1/19/2025 in #questions
Extract schema inside an array
I just remember David talking about it some time
11 replies
Aarktype
Created by Nicolas on 1/19/2025 in #questions
Extract schema inside an array
Idk how it's called check the sauce or runtime
11 replies
Aarktype
Created by Nicolas on 1/19/2025 in #questions
Extract schema inside an array
Maybe you need some .arrayitem as .get(0) is for tuples?
11 replies
Aarktype
Created by Sebaestschjin on 1/16/2025 in #questions
Recursive types and d.ts files
You cannot export the recursive type itself, but you can export the definition type and use type.infer to compile it
8 replies
Aarktype
Created by DiamondDragon on 1/18/2025 in #questions
exact length "string = 2"
= means default So here you need 2<=string.alpha<=2
10 replies
Aarktype
Created by Tom on 1/7/2025 in #questions
Can arktype drop data not covered by schema?
const user = type({
name: "string",
'+': 'delete', // or 'reject'
})

const out = user({name: "bob", age: 51})
const user = type({
name: "string",
'+': 'delete', // or 'reject'
})

const out = user({name: "bob", age: 51})
8 replies
Aarktype
Created by Tom on 1/7/2025 in #questions
Can arktype drop data not covered by schema?
https://arktype.io/docs/objects#properties-undeclared @ArkDavid rejoice, it's my first completely doc answer!
8 replies
Aarktype
Created by Asfamilybank on 12/16/2024 in #questions
Why are the partial operator `?` and explicit `undefined` incompatible?
It's planned https://github.com/arktypeio/arktype/issues/1191 but not implemented
17 replies
Aarktype
Created by Asfamilybank on 12/16/2024 in #questions
Why are the partial operator `?` and explicit `undefined` incompatible?
@Asfamilybank for now just be verbose and
import { type } from 'arktype';

const checkType = type({
'redirect?': 'string | undefined'
});

checkType({}); // pass
checkType({ redirect: undefined }); // ArkTypeError
import { type } from 'arktype';

const checkType = type({
'redirect?': 'string | undefined'
});

checkType({}); // pass
checkType({ redirect: undefined }); // ArkTypeError
I guess
17 replies
Aarktype
Created by Asfamilybank on 12/16/2024 in #questions
Why are the partial operator `?` and explicit `undefined` incompatible?
But how to use exactOptionalPropertyTypes=false 🤔
17 replies
Aarktype
Created by Asfamilybank on 12/16/2024 in #questions
Why are the partial operator `?` and explicit `undefined` incompatible?
Installation You'll also need... - TypeScript version >=5.1. - A package.json with "type": "module" (or an environment that supports ESM imports) - A tsconfig.json with... - strict or strictNullChecks (required) - skipLibCheck (strongly recommended, see FAQ) - exactOptionalPropertyTypes (recommended)
17 replies
Aarktype
Created by Asfamilybank on 12/16/2024 in #questions
Why are the partial operator `?` and explicit `undefined` incompatible?
No description
17 replies
Aarktype
Created by Asfamilybank on 12/16/2024 in #questions
Why are the partial operator `?` and explicit `undefined` incompatible?
Nvm is was strictNullChecks
17 replies