Skip to content

Commit

Permalink
Nullable type should allow for undefined schema prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoniangreen committed Apr 3, 2024
1 parent 32fb40e commit e21dd06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/types/json-schema.ts
Expand Up @@ -174,7 +174,7 @@ export type RequiredMembers<T> = StrictNullChecksWrapper<

type Nullable<T> = undefined extends T
? {
nullable: true
nullable?: true
const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const
enum?: Readonly<(T | null)[]> // `null` must be explicitly included in "enum" for `null` to pass
default?: T | null
Expand Down

0 comments on commit e21dd06

Please sign in to comment.