0
Fork 0
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:
bholmesdev 2024-01-25 11:53:45 -05:00
parent 253ad9bc2d
commit 85358de062

View file

@ -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;
}