MCPcopy Index your code
hub / github.com/expressjs/body-parser / createDecompressionStream

Function createDecompressionStream

lib/read.js:214–231  ·  view source on GitHub ↗

* Create a decompression stream for the given encoding. * @param {string} encoding * @param {Function} debug * @returns {Object} * @private

(encoding, debug)

Source from the content-addressed store, hash-verified

212 * @private
213 */
214function createDecompressionStream (encoding, debug) {
215 switch (encoding) {
216 case 'deflate':
217 debug('inflate body')
218 return zlib.createInflate()
219 case 'gzip':
220 debug('gunzip body')
221 return zlib.createGunzip()
222 case 'br':
223 debug('brotli decompress body')
224 return zlib.createBrotliDecompress()
225 default:
226 throw createError(415, 'unsupported content encoding "' + encoding + '"', {
227 encoding: encoding,
228 type: 'encoding.unsupported'
229 })
230 }
231}
232
233/**
234 * Dump the contents of a request.

Callers 1

contentstreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…