pino-std-serializers
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -15,3 +15,3 @@ 'use strict' | ||
}, | ||
header: { | ||
headers: { | ||
enumerable: true, | ||
@@ -39,3 +39,3 @@ writable: true, | ||
_res.statusCode = res.statusCode | ||
_res.header = res._header | ||
_res.headers = res._headers | ||
_res.raw = res | ||
@@ -42,0 +42,0 @@ return _res |
{ | ||
"name": "pino-std-serializers", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "A collection of standard object serializers for Pino", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -73,3 +73,3 @@ # pino-std-serializers | ||
statusCode: Number, | ||
header: Array, // The list of headers to be sent in the response. | ||
headers: Object, // The headers to be sent in the response. | ||
raw: Object // Non-enumerable, i.e. will not be in the output, original | ||
@@ -76,0 +76,0 @@ // response object. This is available for subsequent serializers |
@@ -57,3 +57,3 @@ 'use strict' | ||
var serailizer = wrapResponseSerializer(function (res) { | ||
var serializer = wrapResponseSerializer(function (res) { | ||
t.ok(res.statusCode) | ||
@@ -67,3 +67,3 @@ t.is(res.statusCode, 200) | ||
res.statusCode = 200 | ||
var serialized = serailizer(res) | ||
var serialized = serializer(res) | ||
t.notOk(serialized.statusCode) | ||
@@ -73,1 +73,20 @@ res.end() | ||
}) | ||
test('res.headers is serialized', function (t) { | ||
t.plan(1) | ||
var server = http.createServer(handler) | ||
server.unref() | ||
server.listen(0, () => { | ||
http.get(server.address(), () => {}) | ||
}) | ||
t.tearDown(() => server.close()) | ||
function handler (req, res) { | ||
res.setHeader('x-custom', 'y') | ||
var serialized = serializers.resSerializer(res) | ||
t.is(serialized.headers['x-custom'], 'y') | ||
res.end() | ||
} | ||
}) |
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
19798
526