File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -361,9 +361,9 @@ export type Database = {
361
361
} )
362
362
363
363
return `{
364
- ${ argsNameAndType . map (
365
- ( { name , type } ) => ` ${ JSON . stringify ( name ) } : ${ type } `
366
- ) }
364
+ ${ argsNameAndType
365
+ . toSorted ( ( a , b ) => a . name . localeCompare ( b . name ) )
366
+ . map ( ( { name , type } ) => ` ${ JSON . stringify ( name ) } : ${ type } ` ) }
367
367
}`
368
368
}
369
369
@@ -373,19 +373,21 @@ export type Database = {
373
373
)
374
374
if ( relation ) {
375
375
return `{
376
- ${ columnsByTableId [ relation . id ] . map (
377
- ( column ) =>
378
- `${ JSON . stringify ( column . name ) } : ${ pgTypeToTsType (
379
- schema ,
380
- column . format ,
381
- {
382
- types,
383
- schemas,
384
- tables,
385
- views,
386
- }
387
- ) } ${ column . is_nullable ? '| null' : '' } `
388
- ) }
376
+ ${ columnsByTableId [ relation . id ]
377
+ . toSorted ( ( a , b ) => a . name . localeCompare ( b . name ) )
378
+ . map (
379
+ ( column ) =>
380
+ `${ JSON . stringify ( column . name ) } : ${ pgTypeToTsType (
381
+ schema ,
382
+ column . format ,
383
+ {
384
+ types,
385
+ schemas,
386
+ tables,
387
+ views,
388
+ }
389
+ ) } ${ column . is_nullable ? '| null' : '' } `
390
+ ) }
389
391
}`
390
392
}
391
393
You can’t perform that action at this time.
0 commit comments