export default function pick < T extends Record < string , unknown > , K extends keyof T > ( obj , keys ) { const clone = { } as Pick < T , K > ; keys . forEach ( ( key ) => { const k = key as K ; if ( key in obj ) { clone [ k ] = obj [ k ] ; } } ) ; return clone ; }