From ebc101d02864d50efb84d511d66905bd2548c7ea Mon Sep 17 00:00:00 2001 From: Alexander Bolshakov Date: Mon, 18 Sep 2023 10:08:42 +0400 Subject: [PATCH] Fix #674 TypeScript issues with dynamic inserts --- types/index.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index d76cb3b2..8dacd9c4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -177,9 +177,17 @@ type Rest = T extends TemplateStringsArray ? never : // force fallback to the tagged template function overload T extends string ? readonly string[] : T extends readonly any[][] ? readonly [] : - T extends readonly (object & infer R)[] ? readonly (Keys & keyof R)[] : + T extends readonly (object & infer R)[] ? ( + readonly (Keys & keyof R)[] // sql(data, "prop", "prop2") syntax + | + [readonly (Keys & keyof R)[]] // sql(data, ["prop", "prop2"]) syntax + ) : T extends readonly any[] ? readonly [] : - T extends object ? readonly (Keys & keyof T)[] : + T extends object ? ( + readonly (Keys & keyof T)[] // sql(data, "prop", "prop2") syntax + | + [readonly (Keys & keyof T)[]] // sql(data, ["prop", "prop2"]) syntax + ) : any type Return =