export const createPlaceholders = ( arr: any[] ) => { return arr.map(() => '?').join(', '); } export type AddDollarPrefix = { [K in keyof T as `$${string & K}`]: T[K]; }; export function prefixKeysWithDollar>(obj: T): AddDollarPrefix { const result = {} as AddDollarPrefix; for (const key in obj) { const newKey = `$${key}` as keyof AddDollarPrefix; result[newKey] = obj[key] as any; } return result; } export function transformArray>(arr: T[]): AddDollarPrefix[] { return arr.map(prefixKeysWithDollar); } export function pad_l2 ( _thing: string | number ): string { if ( typeof _thing == "number" ) { _thing = JSON.stringify(_thing); }; return _thing.padStart(2, "0"); }