File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -227,21 +227,17 @@ export class JSONSchemaGenerator {
227227 case "unknown" : {
228228 break ;
229229 }
230- case "undefined" : {
231- const json = _json as JSONSchema . NullSchema ;
232- json . type = "null" ;
230+ case "undefined" :
231+ case "void" : {
232+ if ( this . unrepresentable === "throw" ) {
233+ throw new Error ( "Undefined cannot be represented in JSON Schema" ) ;
234+ }
233235 break ;
234236 }
235237 case "never" : {
236238 _json . not = { } ;
237239 break ;
238240 }
239- case "void" : {
240- if ( this . unrepresentable === "throw" ) {
241- throw new Error ( "Void cannot be represented in JSON Schema" ) ;
242- }
243- break ;
244- }
245241 case "date" : {
246242 if ( this . unrepresentable === "throw" ) {
247243 throw new Error ( "Date cannot be represented in JSON Schema" ) ;
You can’t perform that action at this time.
0 commit comments