node_modules/@adonisjs/fold/src/Ioc/index.js
/**
   * Same as `make` but instead returns the instance of the object
   * with the check that a method exists on the resolved object.
   * If that method does not exists it will throw an exception.
   *
   * It is helpful for scanerios like Route controller binding.
   *
   * @method makeFunc
   *
   * @param  {String} pattern
   * @return {Object}
   *
   * @throws {InvalidArgumentException} If pattern is not a string with dot notation.
   * @throws {RuntimeException} If method on the given namespace is missing.
   *
   * @example
   * ```
   * Ioc.makeFunc('App/Http/Controllers/UsersController.index')
   * // returns
   * { instance: UsersControllerInstance, method: index }
   * // usage
   * instance[method].apply(instance, [...args])
   * ```
   */
Same as `make` but instead returns the instance of the object
with the check that a method exists on the resolved object.
If that method does not exists it will throw an exception.

It is helpful for scanerios like Route controller binding.

@method makeFunc

@param  {String} pattern
@return {Object}

@throws {InvalidArgumentException} If pattern is not a string with dot notation.
@throws {RuntimeException} If method on the given namespace is missing.


Same as ` make ` but instead returns the instance of the object with the check that a method exists on the resolved object . If that method does not exists it will throw an exception . It is helpful for scanerios like Route controller binding . @method makeFunc @param { String } pattern @return { Object } @throws { InvalidArgumentException } If pattern is not a string with dot notation . @throws { RuntimeException } If method on the given namespace is missing .
makeFunc (pattern) {
    const [namespace, method, ...rest] = pattern.split(/\b\./g)
    if (!namespace || !method || rest.length) {
      const message = `Ioc.makeFunc expects a string in module.method format instead received ${pattern}`
      throw GE.InvalidArgumentException.invoke(message, 500, 'E_INVALID_MAKE_STRING')
    }
    const normalizedNamespace = namespace.replace(/\\./g, '.')
    const instance = this.make(normalizedNamespace)
    if (!instance[method]) {
      throw GE.RuntimeException.invoke(`Method ${method} missing on ${normalizedNamespace}`, 500, 'E_UNDEFINED_METHOD')
    }
    return { instance, method: instance[method].bind(instance) }
  }
makeFunc ( pattern ) { const [ namespace , method , ... rest ] = pattern . split ( / \b\. / g ) if ( ! namespace || ! method || rest . length ) { const message = ` ${ pattern } ` throw GE . InvalidArgumentException . invoke ( message , 500 , 'E_INVALID_MAKE_STRING' ) } const normalizedNamespace = namespace . replace ( / \\. / g , '.' ) const instance = this . make ( normalizedNamespace ) if ( ! instance [ method ] ) { throw GE . RuntimeException . invoke ( ` ${ method } ${ normalizedNamespace } ` , 500 , 'E_UNDEFINED_METHOD' ) } return { instance , method : instance [ method ] . bind ( instance ) } }
Same as `make` but instead returns the instance of the object
 with the check that a method exists on the resolved object.
Same as ` make ` but instead returns the instance of the object with the check that a method exists on the resolved object .