export function pick < T extends Record < string , any > , K extends keyof T > ( input , fields ) { const output = { } as T ; fields . forEach ( field => { if ( field in input ) { output [ field ] = input [ field ] ; } } ) ; return output ; }