Skip to content

Commit 19308c2

Browse files
committed
fix: make Json object values possibly undefined
See also denoland/std#2565. Omitting `undefined` makes the `Json` type pretty annoying to use, e.g. when passing values to `jsonb` columns/params.
1 parent 166fda0 commit 19308c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/server/templates/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const apply = ({
4040
}, {} as Record<string, PostgresColumn[]>)
4141

4242
let output = `
43-
export type Json = string | number | boolean | null | { [key: string]: Json } | Json[]
43+
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]
4444
4545
export interface Database {
4646
${schemas

test/server/typegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('typegen', async () => {
1111
| number
1212
| boolean
1313
| null
14-
| { [key: string]: Json }
14+
| { [key: string]: Json | undefined }
1515
| Json[]
1616
1717
export interface Database {

0 commit comments

Comments
 (0)