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 {
227
227
case "unknown" : {
228
228
break ;
229
229
}
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
+ }
233
235
break ;
234
236
}
235
237
case "never" : {
236
238
_json . not = { } ;
237
239
break ;
238
240
}
239
- case "void" : {
240
- if ( this . unrepresentable === "throw" ) {
241
- throw new Error ( "Void cannot be represented in JSON Schema" ) ;
242
- }
243
- break ;
244
- }
245
241
case "date" : {
246
242
if ( this . unrepresentable === "throw" ) {
247
243
throw new Error ( "Date cannot be represented in JSON Schema" ) ;
You can’t perform that action at this time.
0 commit comments