Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Narrow inferIn vs inferOut - arktype
a
arktype
•
8mo ago
•
7 replies
Gabriel Silva
Narrow inferIn vs inferOut
Maybe I misunderstood the expression
, but I expected the In type to be
teamId: string | null
teamId: string | null
and the Out type to be
teamId: string
teamId: string
. How can I achieve that
, if not with narrow
?
https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%250A%250Atype%2520In%2520%253D%2520typeof%2520Schema.inferIn%253B%250Atype%2520Out%2520%253D%2520typeof%2520Schema.inferOut%253B%250Aconst%2520Schema%2520%253D%2520type%28%257B%250A%2520%2520%2520%2520emails%253A%2520%2522string.email%255B%255D%2522%252C%250A%2520%2520%2520%2520teamId%253A%2520%255B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522string%2520%257C%2520null%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522%253A%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%28str%252C%2520ctx%29%253A%2520str%2520is%2520NonNullable%253Ctypeof%2520str%253E%2520%253D%253E%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520str%2520%21%253D%2520null%2520%253F%2520true%2520%253A%2520ctx.mustBe%28%2522a%2520teamId%2522%29%252C%250A%2520%2520%2520%2520%255D%252C%250A%257D%29%253B
ArkType
ArkType Playground
TypeScript
's
1
:1 validator
, optimized from editor to runtime
arktype
Join
This is a friendly space centered around ArkType, TypeScript's 1:1 validator (https://github.com/arktypeio/arktype)
860
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Was this page helpful?
Yes
No
Similar Threads
Recent Announcements
Similar Threads
`narrow` vs `satisfying`
a
arktype / questions
16mo ago
Is it possible to inferOut generics?
a
arktype / questions
7mo ago
Scope and narrow
a
arktype / questions
14mo ago
Generic with Narrow/Morph
a
arktype / questions
2y ago