SearchSetup for Free
arktypea
arktype•9mo ago
Tehrin

.narrow(...).in doesn't return the original type

Example: https://arktype.io/playground?code=import%2520%257B%2520type%2520%257D%2520from%2520%2522arktype%2522%250A%250Aconst%2520Thing%2520%253D%2520type%28%257B%250A%2509a%253A%2520%2522string%2522%252C%250A%2520%2520%2520%2520b%253A%2520%2522string%2522%250A%257D%29.narrow%28%28obj%252C%2520ctx%29%2520%253D%253E%2520%257B%250A%2520%2520%2520%2520if%2520%28obj.a%2520%21%253D%2520obj.b%29%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520return%2520ctx.reject%28%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520problem%253A%2520%2522Mismatch%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520path%253A%2520%255B%2522b%2522%255D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%29%250A%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520return%2520true%253B%250A%257D%29%253B%250A%250Aconst%2520out%2520%253D%2520Thing%28%257B%250A%2520%2520%2520%2520a%253A%2520%2522Hello%2522%252C%250A%2520%2520%2520%2520b%253A%2520%2522Hi%2522%252C%250A%257D%29%250A

I'm mostly looking at .in.in to be able to call .toJsonSchema.toJsonSchema
For the moment I'm using .pipe.pipe but this sounds like a bug
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
.in
.in
.toJsonSchema
.toJsonSchema
.pipe
.pipe

Similar Threads

type narrow issue on result
arktypeaarktype / questions
9mo ago
morph then narrow with an existing type?
arktypeaarktype / questions
3y ago