UNPKG

moy-fp

Version:
13 lines (10 loc) 293 B
import curry from './curry' import nAry from './nAry' import lastList from '../List/lastList' /** * Number -> String -> ((a, b, ..., m, Object) -> *) */ const invoker = curry( (n, method) => nAry(n + 1, (...args) => lastList(args)[method](...args.slice(0, -1))) ) export default invoker