SynthLuvr
Aarktype
•Created by SynthLuvr on 9/28/2024 in #questions
Property 'describe' does not exist on type 'instantiateType<inferTupleExpression<...>, {}>'
This used to work, but now in the latest version it results in error:
13 replies
Aarktype
•Created by SynthLuvr on 9/28/2024 in #questions
Piping types no longer works
In previous version of ArkType (have tested
2.0.0-rc.7
and below), this worked as intended where it'll throw an error since d
does not match a/b/c.
In ArkType >= 2.0.0-rc.13
this now doesn't throw an error and instead outputs d
12 replies
Aarktype
•Created by SynthLuvr on 9/6/2024 in #questions
Type instantiation is excessively deep and possibly infinite
Produces error:
52 replies
Aarktype
•Created by SynthLuvr on 9/4/2024 in #questions
Record with number as key?
This throws error:
But it should be valid:
6 replies
Aarktype
•Created by SynthLuvr on 9/2/2024 in #questions
Compiling to JavaScript results in `any` type
I have a TypeScript library that compiles down into JavaScript, and one of the
d.ts
files looks like this:
In this example, Address
is of type any
, whereas when I'm in TypeScript it's of type string
3 replies
Aarktype
•Created by SynthLuvr on 9/2/2024 in #questions
Was `any` removed?
I used to be able to do:
type("any");
. Now it's throwing error Argument of type '"any"' is not assignable to parameter of type '"'any' is unresolvable "'
15 replies
Aarktype
•Created by SynthLuvr on 9/2/2024 in #questions
Type instantiation is excessively deep and possibly infinite
This used to work for me in in
2.0.0-dev.29
. But upgrading to 2.0.0-rc.5
I get:
18 replies
Aarktype
•Created by SynthLuvr on 8/6/2024 in #questions
ArkType mutates original input?
I was always under the assumption that ArkType leaves the original input intact. However:
Outputs:
My assumption was that value would remain as string, and the result returned by
Parser
would be this value. But based on this, it seems like I was under the wrong assumption.74 replies
Aarktype
•Created by SynthLuvr on 7/13/2024 in #questions
ParseError: Root of kind union should be one of alias,intersection,unit,domain,proto
Produces error:
8 replies
Aarktype
•Created by SynthLuvr on 6/12/2024 in #questions
Can you create types with dynamic literals?
Say I have this function:
With this I'm trying to create types with literals but I don't know those literals until runtime.
If I run:
It creates type:
But instead what I'm actually wanting is:
Which produces the correct type:
44 replies
Aarktype
•Created by SynthLuvr on 6/11/2024 in #questions
Cannot assign to Type
This works fine in version
2.0.0-dev.19
. However, updating to 2.0.0-dev.20
or above it throws this error:
3 replies
Aarktype
•Created by SynthLuvr on 6/11/2024 in #questions
How to validate `Record<string, string>`?
My naïve attempt:
This results in error:
7 replies
Aarktype
•Created by SynthLuvr on 6/11/2024 in #questions
Property 'name' is missing in type
This results in error:
This can be resolved by using
type
:
Is this the intended usage, or a bug? Because I was expecting that type
would be implied within scope
15 replies
Aarktype
•Created by SynthLuvr on 6/8/2024 in #questions
Type 'distillOut<T>' is not assignable to type 'T'.
This produces error:
If I cast, then it works:
Why is the casting necessary? Shouldn't it be type
T
after checking it's not type.errors
?25 replies
Aarktype
•Created by SynthLuvr on 5/25/2024 in #questions
How to improve error messages?
address must be a string and less than length 200 and more than length 50 and valid according to an anonymous predicate and valid according to an anonymous predicate and valid according to an anonymous predicate (was missing)This is an example of a validation error message returned. How could I go about making that a little more human friendly?
7 replies
Aarktype
•Created by SynthLuvr on 5/24/2024 in #questions
Pipe required before narrow
Results in error:
However, adding
pipe
before calling narrow
works:
Is this intentional?5 replies
Aarktype
•Created by SynthLuvr on 5/23/2024 in #questions
Error transforming object
I'm having some trouble doing transforming some data
9 replies