appolo-agent
Advanced tools
Comparing version 6.0.28 to 6.0.29
@@ -273,3 +273,3 @@ import {IOptions} from "./IOptions"; | ||
public use(path: string | MiddlewareHandlerParams, ...fn: MiddlewareHandlerParams[]): this { | ||
public use(path?: string | MiddlewareHandlerParams, ...fn: MiddlewareHandlerParams[]): this { | ||
@@ -276,0 +276,0 @@ if (typeof path === "string") { |
@@ -7,2 +7,3 @@ "use strict"; | ||
const _ = require("lodash"); | ||
const mime = require("mime"); | ||
const middleware_1 = require("./middleware"); | ||
@@ -124,2 +125,8 @@ const statusEmpty = { | ||
}; | ||
proto.contentType = proto.type = function contentType(type) { | ||
let ct = type.indexOf('/') === -1 | ||
? mime.getType(type) | ||
: type; | ||
return this.set('Content-Type', ct); | ||
}; | ||
proto.jsonp = function (data) { | ||
@@ -126,0 +133,0 @@ let body = data; |
@@ -5,2 +5,3 @@ import http = require('http'); | ||
import _ = require('lodash'); | ||
import mime = require('mime'); | ||
import {IRequest} from "./request"; | ||
@@ -206,2 +207,10 @@ import {handleMiddleware} from "./middleware"; | ||
proto.contentType = proto.type = function contentType(type: string) { | ||
let ct = type.indexOf('/') === -1 | ||
? mime.getType(type) | ||
: type; | ||
return this.set('Content-Type', ct); | ||
}; | ||
proto.jsonp = function (data: any) { | ||
@@ -208,0 +217,0 @@ let body = data; |
@@ -27,3 +27,3 @@ { | ||
"main": "./index.js", | ||
"version": "6.0.28", | ||
"version": "6.0.29", | ||
"license": "MIT", | ||
@@ -43,2 +43,3 @@ "repository": { | ||
"lodash": "^4.17.11", | ||
"mime": "^2.4.3", | ||
"qs": "^6.6.0", | ||
@@ -56,2 +57,3 @@ "tslib": "^1.9.3", | ||
"@types/lodash": "^4.14.119", | ||
"@types/mime": "^2.0.1", | ||
"@types/mocha": "^5.2.5", | ||
@@ -58,0 +60,0 @@ "@types/node": "^10.12.14", |
Sorry, the diff of this file is not supported yet
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
103266
1742
10
31
+ Addedmime@^2.4.3
+ Addedmime@2.6.0(transitive)