( body: string, options?: ServerResponse.Options.WithContentType )
| 133 | |
| 134 | /** @internal */ |
| 135 | export const text = ( |
| 136 | body: string, |
| 137 | options?: ServerResponse.Options.WithContentType |
| 138 | ): ServerResponse.HttpServerResponse => { |
| 139 | const headers = options?.headers ? Headers.fromInput(options.headers) : Headers.empty |
| 140 | return new ServerResponseImpl( |
| 141 | options?.status ?? 200, |
| 142 | options?.statusText, |
| 143 | headers, |
| 144 | options?.cookies ?? Cookies.empty, |
| 145 | internalBody.text(body, getContentType(options, headers)) |
| 146 | ) |
| 147 | } |
| 148 | |
| 149 | /** @internal */ |
| 150 | export const html: { |
no test coverage detected
searching dependent graphs…