Comparing version 0.0.3 to 0.0.4
@@ -8,3 +8,3 @@ import { Readable } from 'stream'; | ||
*/ | ||
export declare type Body = undefined | string | Buffer | Readable | {}; | ||
export declare type Body = undefined | string | Buffer | Readable; | ||
/** | ||
@@ -82,3 +82,2 @@ * Raw HTTP header formats allowed. | ||
text(maxBufferSize?: number): Promise<string | undefined>; | ||
json(maxBufferSize?: number): Promise<{}>; | ||
} | ||
@@ -85,0 +84,0 @@ /** |
@@ -274,3 +274,4 @@ "use strict"; | ||
this.type = 'application/json'; | ||
this.length = undefined; | ||
this._body = JSON.stringify(body); | ||
this.length = Buffer.byteLength(this._body); | ||
} | ||
@@ -409,11 +410,2 @@ throw new TypeError("Unknown body: " + body); | ||
}; | ||
Common.prototype.json = function (maxBufferSize) { | ||
if (isBasicObject(this._body)) { | ||
var body = this._body; | ||
this._body = undefined; | ||
this._bodyUsed = true; | ||
return Promise.resolve(body); | ||
} | ||
return this.text(maxBufferSize).then(function (x) { return x ? JSON.parse(x) : undefined; }); | ||
}; | ||
return Common; | ||
@@ -420,0 +412,0 @@ }()); |
"use strict"; | ||
var index_1 = require("./index"); | ||
describe('httpco', function () { | ||
describe('servie', function () { | ||
describe('common', function () { | ||
@@ -5,0 +5,0 @@ it('should accept headers', function () { |
{ | ||
"name": "servie", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Standard HTTP interfaces", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.js", | ||
}, | ||
"license": "MIT", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
@@ -41,0 +41,0 @@ "url": "https://github.com/blakeembrey/node-servie/issues" |
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
73058
766