appolo-agent
Advanced tools
Comparing version 6.0.8 to 6.0.9
@@ -14,2 +14,4 @@ "use strict"; | ||
const events_1 = require("./events"); | ||
const defaults_1 = require("./defaults"); | ||
const http = require("http"); | ||
const _ = require("lodash"); | ||
@@ -23,15 +25,2 @@ const url = require("url"); | ||
super(); | ||
this.Defaults = { | ||
errorStack: false, | ||
errorMessage: true, | ||
maxRouteCache: 10000, | ||
useRouteCache: true, | ||
decodeUrlParams: false, | ||
qsParser: "qs", | ||
urlParser: "fast", | ||
viewExt: "html", | ||
viewCache: true, | ||
viewEngine: null, | ||
viewFolder: "" | ||
}; | ||
this.handle = (request, response) => { | ||
@@ -57,3 +46,3 @@ let req = request_1.createRequest(request), res = response_1.createResponse(request, response); | ||
}; | ||
this._options = _.defaults(options || {}, this.Defaults); | ||
this._options = _.defaults(options || {}, defaults_1.Defaults); | ||
this._qsParse = this._options.qsParser === "qs" ? qs.parse : querystring.parse; | ||
@@ -149,4 +138,7 @@ this._urlParse = this._options.urlParser === "fast" ? util_1.Util.parseUrlFast : url.parse; | ||
} | ||
decorate(fn) { | ||
fn(http.IncomingMessage.prototype, http.ServerResponse.prototype, this._requestApp.constructor.prototype); | ||
} | ||
} | ||
exports.Agent = Agent; | ||
//# sourceMappingURL=agent.js.map |
@@ -15,2 +15,3 @@ import {IOptions} from "./IOptions"; | ||
import {Events} from "./events"; | ||
import {Defaults} from "./defaults"; | ||
import http = require('http'); | ||
@@ -35,15 +36,2 @@ import https = require('https'); | ||
protected readonly Defaults: IOptions = { | ||
errorStack: false, | ||
errorMessage: true, | ||
maxRouteCache: 10000, | ||
useRouteCache: true, | ||
decodeUrlParams: false, | ||
qsParser: "qs", | ||
urlParser: "fast", | ||
viewExt: "html", | ||
viewCache: true, | ||
viewEngine: null, | ||
viewFolder: "" | ||
}; | ||
@@ -54,3 +42,3 @@ public constructor(options?: IOptions) { | ||
this._options = _.defaults(options || {}, this.Defaults); | ||
this._options = _.defaults(options || {}, Defaults); | ||
@@ -211,2 +199,6 @@ this._qsParse = this._options.qsParser === "qs" ? qs.parse : querystring.parse; | ||
} | ||
public decorate(fn: (req: http.IncomingMessage, res: http.ServerResponse, app: this) => void) { | ||
fn(http.IncomingMessage.prototype, http.ServerResponse.prototype, this._requestApp.constructor.prototype) | ||
} | ||
} |
@@ -27,3 +27,3 @@ { | ||
"main": "./index.js", | ||
"version": "6.0.8", | ||
"version": "6.0.9", | ||
"license": "MIT", | ||
@@ -57,2 +57,4 @@ "repository": { | ||
"@types/qs": "^6.5.1", | ||
"@types/sinon": "^5.0.2", | ||
"@types/sinon-chai": "^3.2.0", | ||
"@types/supertest": "^2.0.6", | ||
@@ -67,7 +69,9 @@ "@types/type-is": "^1.6.2", | ||
"consolidate": "^0.15.1", | ||
"express": "^4.16.3", | ||
"fastify": "^1.12.1", | ||
"express": "^4.16.3", | ||
"mocha": "^5.2.0", | ||
"nunjucks": "^3.1.3", | ||
"nyc": "^13.0.1", | ||
"sinon": "^6.3.4", | ||
"sinon-chai": "^3.2.0", | ||
"supertest": "^3.3.0", | ||
@@ -74,0 +78,0 @@ "typescript": "^3.1.1" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79595
59
1322
29
5