function()

in composer.js [329:340]


  function (fun) {
    if (arguments.length > 1) throw new ComposerError('Too many arguments in "function" combinator')
    if (typeof fun === 'function') {
      fun = `${fun}`
      if (fun.indexOf('[native code]') !== -1) throw new ComposerError('Cannot capture native function in "function" combinator', fun)
    }
    if (typeof fun === 'string') {
      fun = { kind: 'nodejs:default', code: fun }
    }
    if (!isObject(fun)) throw new ComposerError('Invalid argument "function" in "function" combinator', fun)
    return new Composition({ type: 'function', function: { exec: fun }, '.combinator': () => combinators.function })
  },