export { newPgConnectionConfig } from "./connection" ; export function fail ( message ? ) { throw new Error ( message || "Failed" ) ; } export function groupBy < T , Y = T > ( list , fn , valueFn ? ) { const result = { } ; list . forEach ( ( o ) => { const group = fn ( o ) ; if ( result [ group ] === undefined ) { result [ group ] = [ ] ; } result [ group ] . push ( valueFn === undefined ? ( ( o as any ) as Y ) : valueFn ( o ) ) ; } ) ; return result ; }