mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
fix: use Extract to narrow keyof to strings
This commit is contained in:
parent
253ad9bc2d
commit
85358de062
1 changed files with 2 additions and 3 deletions
|
@ -206,12 +206,11 @@ export type Table<
|
|||
columns: {
|
||||
id: AstroId<{ tableName: TTableName }>;
|
||||
} & {
|
||||
[K in keyof TFields]: Column<
|
||||
[K in Extract<keyof TFields, string>]: Column<
|
||||
TFields[K]['type'],
|
||||
{
|
||||
tableName: TTableName;
|
||||
// TODO: narrow K to string
|
||||
name: string;
|
||||
name: K;
|
||||
hasDefault: TFields[K]['default'] extends undefined ? false : true;
|
||||
notNull: TFields[K]['optional'] extends true ? false : true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue