packageDocumentation module import { NeededUnionType } from "../types" ; typeparam typeparam export type Picker < K extends string [ ] > = < O extends { [ P in NeededUnionType < K > ] : any ; } > ( object : O ) => Pick < O , NeededUnionType < K > > ; param keys typeparam returns export const pick = < K extends string [ ] > ( ... keys ) : Picker < K > => object => Object . keys ( object ) . reduce ( ( acc , key ) => { if ( keys . includes ( key ) ) { acc [ key ] = object [ key as keyof object ] ; } return acc ; } , { } as any ) ; typeparam typeparam export type Omitter < K extends string [ ] > = < O extends { [ P in NeededUnionType < K > ] : any ; } > ( object : O ) => Omit < O , NeededUnionType < K > > ; param keys typeparam returns export const omit = < K extends string [ ] > ( ... keys ) : Omitter < K > => object => Object . keys ( object ) . reduce ( ( acc , key ) => { if ( ! keys . includes ( key ) ) { acc [ key ] = object [ key as keyof object ] ; } return acc ; } , { } as any ) ;