Buckets:
| module.exports = { | |
| mapHttpResponse, | |
| resSerializer | |
| } | |
| const rawSymbol = Symbol('pino-raw-res-ref') | |
| const pinoResProto = Object.create({}, { | |
| statusCode: { | |
| enumerable: true, | |
| writable: true, | |
| value: 0 | |
| }, | |
| headers: { | |
| enumerable: true, | |
| writable: true, | |
| value: '' | |
| }, | |
| raw: { | |
| enumerable: false, | |
| get: function () { | |
| return this[rawSymbol] | |
| }, | |
| set: function (val) { | |
| this[rawSymbol] = val | |
| } | |
| } | |
| }) | |
| Object.defineProperty(pinoResProto, rawSymbol, { | |
| writable: true, | |
| value: {} | |
| }) | |
| function resSerializer (res) { | |
| const _res = Object.create(pinoResProto) | |
| _res.statusCode = res.headersSent ? res.statusCode : null | |
| _res.headers = res.getHeaders ? res.getHeaders() : res._headers | |
| _res.raw = res | |
| return _res | |
| } | |
| function mapHttpResponse (res) { | |
| return { | |
| res: resSerializer(res) | |
| } | |
| } | |
Xet Storage Details
- Size:
- 860 Bytes
- Xet hash:
- cda76f3dd02150f515438bf2aae991eb16acd2ed6f925e818faf851c77cfa30e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.