Skip to content

Commit cc15b67

Browse files
authoredAug 24, 2024
Type change to allow typescript > 2.7.2 (#421)
Typescript versions greater than 2.7.2, `keyof` produces `string|number|symbol`, failing on line 40. One fix is have on lines 19 and 22 `Name extends string|number|symbol` instead of `Name extends string`. But this work around may feel a bit not intuitive. Change directly on line 40, `&` with `string` does the trick of fitting types.
1 parent c90f044 commit cc15b67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare module "sql" {
3737
interface TableDefinition<Name extends string, Row> {
3838
name: Name;
3939
schema: string;
40-
columns: {[CName in keyof Row]: ColumnDefinition<CName, Row[CName]>};
40+
columns: {[CName in ((keyof Row) & string)]: ColumnDefinition<CName, Row[CName]>};
4141
dialect?: SQLDialects;
4242
isTemporary?: boolean;
4343
foreignKeys?: {

0 commit comments

Comments
 (0)