import { toArgs } from './toArgs' ; export function composeGetter < T extends object , U1 extends ( ... args : any [ ] ) => any > ( obj , getter1 ) ; export function composeGetter < T extends object , U1 extends ( ... args : any [ ] ) => any , U2 extends ( ... args : any [ ] ) => any > ( obj , getter1 , getter2 ) ; export function composeGetter < T extends object , U1 extends ( ... args : any [ ] ) => any , U2 extends ( ... args : any [ ] ) => any , U3 extends ( ... args : any [ ] ) => any > ( obj , getter1 , getter2 , getter3 ) ; export function composeGetter < T extends object , U1 extends ( ... args : any [ ] ) => any , U2 extends ( ... args : any [ ] ) => any , U3 extends ( ... args : any [ ] ) => any , U4 extends ( ... args : any [ ] ) => any > ( obj , getter1 , getter2 , getter3 , getter4 ) ; export function composeGetter ( ) { const args = toArgs < Function [ ] > ( arguments ) ; return args . reduce ( ( carry , getter ) => getter ( carry ) , args . shift ( ) as object ) ; } export const defineGetter = ( obj , key , get ) : any => { Object . defineProperty ( obj , key , { get , } ) ; return obj ; } ;