MCPcopy
hub / github.com/koajs/koa / toJSON

Function toJSON

lib/context.js:47–57  ·  lib/context.js::toJSON

* Return JSON representation. * * Here we explicitly invoke .toJSON() on each * object, as iteration will otherwise fail due * to the getters and cause utilities such as * clone() to fail. * * @return {Object} * @api public

()

Source from the content-addressed store, hash-verified

45 */
46
47 toJSON () {
48 return {
49 request: this.request.toJSON(),
50 response: this.response.toJSON(),
51 app: this.app.toJSON(),
52 originalUrl: this.originalUrl,
53 req: class="st">'<original node req>',
54 res: class="st">'<original node res>',
55 socket: class="st">'<original node socket>'
56 }
57 },
58
59 /**
60 * Similar to .throw(), adds assertion.

Callers

nothing calls this directly

Calls 1

toJSONMethod · 0.80

Tested by

no test coverage detected