How can I globally configure a subtypes error
ctx
object, code
is just pattern. The closest thing I could do is match on the description, but that seems brittle. Zod seems to expose a .validation
subtype to check on....Is there a way to have defaults apply when a key is undefined, in addition to when a key is missing?
very silly question, is there an easier way to validate the length of a trimmed string?
type("string.trim > 2")
type("string.trim > 2")
Uncaught ParseError: MinLength operand must be a string or an array (was never)
...built-in stringify morphs
string.integer.parse
, but are there similar ones for the other way? e.g. number.integer.stringify
Intersection/Union Validation Errors
'email' is unresolvable
email
magic word is breaking. For example
```ts...Scope and narrow
`.out` is inferring `unknown`
How to build generic functions that use ArkType schemas?
Type<T>
with Type<{}>
in the signature it works 🤔Recursive type problem:
cross posting from #typescript
Recommended syntax for Higher Order Functions?
Hi,
foo:"string[]=['bar']"
2. given a type with all it's default can i create a concrete object from this type with all the default like: const foo=type({bar:"number.integer=42"})
and get back const defObj={bar: 42}
...How to ensure optimal discrimination of union types?
Extract schema inside an array
exact length "string = 2"
stateCode: 'string.alpha = 2'
?
stateCode: type.string.exactlyLength(2)
, works but curious if the =
works...Recursive types and d.ts files
TypeScript first - is possible or not? Can't remember :)
Can arktype drop data not covered by schema?
`.and` with default, expected behavior?