Search
Get Started
a
arktype
•
3y ago
OnkelTem
How to declare an optional schema?
I wonder if it
's possible to define a schema that is ok if data is undefined
.
E
.g
. in
:
declare function foo(a?: string)v void
declare function foo(a?: string)v void
how to declare a schema for
a
a
?
arktype
Join
This is a friendly space centered around ArkType, TypeScript's 1:1 validator (https://github.com/arktypeio/arktype)
855
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
declare
function
foo
(
a
?:
string
)
v
void
declare
function
foo
(
a
?:
string
)
v
void
Similar Threads
Why does an optional property add a " | undefined" instead of just being an optional property?
a
arktype / questions
16mo ago
Extract schema inside an array
a
arktype / questions
12mo ago
Optional key
a
arktype / questions
17mo ago