Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 18x 18x 37x 37x 7x 30x 18x | import HTTP from 'http';
import HttpMethod from 'http/enum/method';
import StatusCode from 'http/enum/status-code';
function getSuccessfulStatusCode(request: HTTP.IncomingMessage): StatusCode {
const method = request.method;
if (method === HttpMethod.POST) {
return StatusCode.CREATED;
} else {
return StatusCode.SUCCESS;
}
}
export default getSuccessfulStatusCode;
|