MCPcopy Create free account
hub / github.com/cujojs/most / invoke

Function invoke

src/invoke.js:5–17  ·  view source on GitHub ↗
(f, args)

Source from the content-addressed store, hash-verified

3/** @author John Hann */
4
5export default function invoke (f, args) {
6 /*eslint complexity: [2,7]*/
7 switch (args.length) {
8 case 0: return f()
9 case 1: return f(args[0])
10 case 2: return f(args[0], args[1])
11 case 3: return f(args[0], args[1], args[2])
12 case 4: return f(args[0], args[1], args[2], args[3])
13 case 5: return f(args[0], args[1], args[2], args[3], args[4])
14 default:
15 return f.apply(void 0, args)
16 }
17}

Callers 3

combine.jsFile · 0.85
sample.jsFile · 0.85
emitZippedFunction · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected