import { curry2 , curryN } from '@typed/functions' ; import { InvokerFn } from './types' ; param arity param method name export const invoker = ( curry2 ( < O , R > ( arity , method ) => curryN ( ( arity + 1 ) as any , function ( ) : R { const target = arguments [ arity ] ; return target [ method ] . apply ( target , Array . prototype . slice . call ( arguments , 0 , arity ) ) ; } ) ) as any ) as InvokerFn ;