Created
January 12, 2020 13:17
-
-
Save WimJongeneel/62295afeef8b97cf2fb7bc906f07e2b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Response { | |
status: string | |
statusCode: number | |
protocol: string | |
headers: Map<string, string> | |
body: string | |
} | |
const compileResponse = (r: Response): string => `${r.protocol} ${r.statusCode} ${r.status} | |
${Array.from(r.headers).map(kv => `${kv[0]}: ${kv[1]}`).join('\r\n')} | |
${r.body}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment