File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -464,6 +464,9 @@ type ParseOptions = {
464464 mode : "passthrough" | "strict" | "strip" ;
465465} ;
466466
467+ /**
468+ * A base class for all concreate validators/parsers.
469+ */
467470abstract class Type < Output = unknown > extends AbstractType < Output > {
468471 nullable ( ) : Type < null | Output > {
469472 return union ( nullSingleton , this ) ;
@@ -514,6 +517,13 @@ abstract class Type<Output = unknown> extends AbstractType<Output> {
514517 }
515518}
516519
520+ /**
521+ * A validator/parser marked as "optional", signifying that their value can
522+ * be missing from the parsed object.
523+ *
524+ * As such optionals can only be used as property validators within
525+ * object validators.
526+ */
517527class Optional < Output = unknown > extends AbstractType < Output | undefined > {
518528 readonly name = "optional" ;
519529
You can’t perform that action at this time.
0 commit comments