* This function runs when a payload that is not a string|buffer|stream or null * should be serialized to be streamed to the response. * This is the default serializer that can be customized by the user using the replySerializer * * @param {object} context the request context * @param {object} d
(context, data, statusCode, contentType)
| 1071 | * @returns {string} the serialized payload |
| 1072 | */ |
| 1073 | function serialize (context, data, statusCode, contentType) { |
| 1074 | const fnSerialize = getSchemaSerializer(context, statusCode, contentType) |
| 1075 | if (fnSerialize) { |
| 1076 | return fnSerialize(data) |
| 1077 | } |
| 1078 | return JSON.stringify(data) |
| 1079 | } |
| 1080 | |
| 1081 | function noop () { } |
| 1082 |
no test coverage detected