import { Omit } from "../" ; export const omit = < T extends { } , K extends keyof T > ( obj , props ) : Omit < T , K > => { let propsArray = Array . isArray ( props ) ? props : [ props ] ; return Object . keys ( obj ) . reduce ( ( prev , k ) => { const key = k as K ; if ( ! propsArray . includes ( key ) ) { prev [ key ] = obj [ key ] ; } return prev ; } , { } as any ) ; } ; export const pick = < T extends { } , K extends keyof T > ( obj , props ) : Pick < T , K > => { let propsArray = Array . isArray ( props ) ? props : [ props ] ; return Object . keys ( obj ) . reduce ( ( prev , k ) => { const key = k as K ; if ( propsArray . includes ( key ) ) { prev [ key ] = obj [ key ] ; } return prev ; } , { } as any ) ; } ;