MCPcopy Create free account
hub / github.com/CodeDredd/h3-compression / getStreamCompression

Function getStreamCompression

src/helper.ts:59–68  ·  view source on GitHub ↗
(event: H3Event)

Source from the content-addressed store, hash-verified

57 * @returns { StreamCompression | undefined }
58 */
59export function getStreamCompression(event: H3Event): StreamCompression | undefined {
60 const encoding = getRequestHeader(event, 'accept-encoding')
61 if (encoding?.includes('gzip'))
62 return 'gzip'
63
64 if (encoding?.includes('deflate'))
65 return 'deflate'
66
67 return undefined
68}
69
70function isReadableStream(value: unknown): boolean {
71 return typeof value === 'object' && value !== null

Callers 1

compressResponseStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected