@@ -54,16 +54,16 @@ type ArrayPostgreSQLTypes = `_${SingleValuePostgreSQLTypes}`
54
54
type TypeScriptSingleValueTypes < T extends SingleValuePostgreSQLTypes > = T extends 'bool'
55
55
? boolean
56
56
: T extends PostgresSQLNumberTypes
57
- ? number
58
- : T extends PostgresSQLStringTypes
59
- ? string
60
- : T extends 'json' | 'jsonb'
61
- ? Json
62
- : T extends 'void'
63
- ? undefined
64
- : T extends 'record'
65
- ? Record < string , unknown >
66
- : unknown
57
+ ? number
58
+ : T extends PostgresSQLStringTypes
59
+ ? string
60
+ : T extends 'json' | 'jsonb'
61
+ ? Json
62
+ : T extends 'void'
63
+ ? undefined
64
+ : T extends 'record'
65
+ ? Record < string , unknown >
66
+ : unknown
67
67
68
68
type StripUnderscore < T extends string > = T extends `_${infer U } ` ? U : T
69
69
@@ -82,9 +82,8 @@ export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) ex
82
82
? I
83
83
: never
84
84
85
- export type LastOf < T > = UnionToIntersection < T extends any ? ( ) => T : never > extends ( ) => infer R
86
- ? R
87
- : never
85
+ export type LastOf < T > =
86
+ UnionToIntersection < T extends any ? ( ) => T : never > extends ( ) => infer R ? R : never
88
87
89
88
export type Push < T extends any [ ] , V > = [ ...T , V ]
90
89
@@ -101,15 +100,14 @@ export type ExtractFirstProperty<T> = T extends { [K in keyof T]: infer U } ? U
101
100
// Type predicates
102
101
export type ContainsNull < T > = null extends T ? true : false
103
102
104
- export type IsNonEmptyArray < T > = Exclude < T , undefined > extends readonly [ unknown , ...unknown [ ] ]
105
- ? true
106
- : false
103
+ export type IsNonEmptyArray < T > =
104
+ Exclude < T , undefined > extends readonly [ unknown , ...unknown [ ] ] ? true : false
107
105
108
106
// Types for working with database schemas
109
107
export type TablesAndViews < Schema extends GenericSchema > = Schema [ 'Tables' ] &
110
108
Exclude < Schema [ 'Views' ] , '' >
111
109
112
110
export type GetTableRelationships <
113
111
Schema extends GenericSchema ,
114
- Tname extends string
112
+ Tname extends string ,
115
113
> = TablesAndViews < Schema > [ Tname ] extends { Relationships : infer R } ? R : false
0 commit comments