lib/koa-respond.js
function patch(ctx) {
    const statusMethods = Object.assign({}, opts.statusMethods, statusCodeMap)
    ctx.send = respond.bind(ctx, ctx)

    // Bind status methods.
    for (const method in statusMethods) {
      const code = statusMethods[method]
      ctx[method] = respond.bind(ctx, ctx, code)
    }

    // Bind other methods
    const methods = Object.assign({}, opts.methods)
    for (const method in methods) {
      const fn = methods[method]
      ctx[method] = fn.bind(ctx, ctx)
    }

    return ctx
  }
function patch(ctx) {
    const statusMethods = Object.assign({}, opts.statusMethods, statusCodeMap)
    ctx.send = respond.bind(ctx, ctx)

    // Bind status methods.
    for (const method in statusMethods) {
      const code = statusMethods[method]
      ctx[method] = respond.bind(ctx, ctx, code)
    }

    // Bind other methods
    const methods = Object.assign({}, opts.methods)
    for (const method in methods) {
      const fn = methods[method]
      ctx[method] = fn.bind(ctx, ctx)
    }

    return ctx
  }
function patch ( ctx ) { const statusMethods = Object . assign ( { } , opts . statusMethods , statusCodeMap ) ctx . send = respond . bind ( ctx , ctx ) // Bind status methods. for ( const method in statusMethods ) { const code = statusMethods [ method ] ctx [ method ] = respond . bind ( ctx , ctx , code ) } // Bind other methods const methods = Object . assign ( { } , opts . methods ) for ( const method in methods ) { const fn = methods [ method ] ctx [ method ] = fn . bind ( ctx , ctx ) } return ctx }
Installs the functions in the context.

@param  {KoaContext} ctx
Installs the functions in the context .