Comparing version 0.2.1 to 0.2.2
@@ -36,3 +36,3 @@ import { Readable } from 'stream'; | ||
constructor(headers: HeaderFormats); | ||
object(): HeadersObject; | ||
object(keepHeaderCase?: boolean): HeadersObject; | ||
object(obj: HeadersObject | null): void; | ||
@@ -39,0 +39,0 @@ set(name: string, value?: string | number | string[]): this; |
@@ -89,3 +89,3 @@ "use strict"; | ||
Headers.prototype.object = function (obj) { | ||
if (arguments.length) { | ||
if (typeof obj === 'object') { | ||
splice(this.raw, 0, this.raw.length); | ||
@@ -102,3 +102,3 @@ if (obj) { | ||
for (var i = 0; i < this.raw.length; i += 2) { | ||
var key = lowerHeader(this.raw[i]); | ||
var key = obj === true ? this.raw[i] : lowerHeader(this.raw[i]); | ||
var value = join(headers[key], this.raw[i + 1]); | ||
@@ -105,0 +105,0 @@ headers[key] = value; |
@@ -11,2 +11,4 @@ "use strict"; | ||
expect(common.headers.raw).toEqual(['X-Test', 'test']); | ||
expect(common.headers.object()).toEqual({ 'x-test': 'test' }); | ||
expect(common.headers.object(true)).toEqual({ 'X-Test': 'test' }); | ||
}); | ||
@@ -13,0 +15,0 @@ }); |
{ | ||
"name": "servie", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Standard HTTP interfaces", | ||
@@ -46,3 +46,3 @@ "main": "dist/index.js", | ||
"rimraf": "^2.5.4", | ||
"tslint": "^4.3.1", | ||
"tslint": "^5.0.0", | ||
"tslint-config-standard": "^4.0.0", | ||
@@ -49,0 +49,0 @@ "typescript": "^2.2.1", |
@@ -20,2 +20,3 @@ # ![Servie](https://cdn.rawgit.com/blakeembrey/node-servie/master/logo.svg) | ||
* [`servie-lambda`](https://github.com/blakeembrey/node-servie-lambda) Servie transport layer for AWS Lambda | ||
* [`servie-http`](https://github.com/blakeembrey/node-servie-http) Servie transport layer for node.js HTTP | ||
* [`busboy`](https://www.npmjs.com/package/busboy) A streaming parser for HTML form data | ||
@@ -31,2 +32,4 @@ * [`qs`](https://github.com/ljharb/qs) and [`querystring`](https://nodejs.org/api/querystring.html) Parse the HTTP query string to an object | ||
* [`servie-cookie-store`](https://github.com/blakeembrey/node-servie-cookie-store) API for managing client-side cookies | ||
* [`servie-errorhandler`](https://github.com/blakeembrey/node-servie-errorhandler) Standard error handler for transport layers | ||
* [`servie-finalhandler`](https://github.com/blakeembrey/node-servie-finalhandler) Standard final handler for transport layers | ||
@@ -55,2 +58,3 @@ ### `Common` | ||
* `bodyUsed` A boolean indicating whether the body has been read | ||
* `bodyBuffered` A boolean indicating whether the body is buffered (e.g. string or buffer, not a stream) | ||
* `type` A shorthand property for reading and writing the `Content-Type` header | ||
@@ -57,0 +61,0 @@ * `length` A shorthand property for reading and writing `Content-Length` as a number |
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
75890
767
206