SearchSetup for Free
arktypea
arktype•5mo ago
Gabriel Silva

Narrow inferIn vs inferOut

Maybe I misunderstood the expression, but I expected the In type to be teamId: string | nullteamId: string | null and the Out type to be teamId: stringteamId: 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
arktypeJoin
This is a friendly space centered around ArkType, TypeScript's 1:1 validator (https://github.com/arktypeio/arktype)
857Members
View on Discord

Similar Threads

Was this page helpful?

Product

PricingDocsCommunities

Resources

AboutBlogChangelogContributors

Legal

TermsPrivacyCookiesEULA
TwitterGitHubDiscord

© 2026 Hedgehog Software, LLC. All rights reserved.

© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
teamId: string | null
teamId: string | null
teamId: string
teamId: string

Similar Threads

`narrow` vs `satisfying`
arktypeaarktype / questions
14mo ago
Is it possible to inferOut generics?
arktypeaarktype / questions
4mo ago
Scope and narrow
arktypeaarktype / questions
11mo ago
Generic with Narrow/Morph
arktypeaarktype / questions
16mo ago