MCPcopy Create free account
hub / github.com/nodejs/node / createDecompressInterceptor

Function createDecompressInterceptor

deps/undici/src/lib/interceptor/decompress.js:267–283  ·  view source on GitHub ↗

* Creates a decompression interceptor for HTTP responses * @param {DecompressHandlerOptions} [options] - Options for the interceptor * @returns {Function} - Interceptor function

(options = {})

Source from the content-addressed store, hash-verified

265 * @returns {Function} - Interceptor function
266 */
267function createDecompressInterceptor (options = {}) {
268 // Emit experimental warning only once
269 if (!warningEmitted) {
270 process.emitWarning(
271 'DecompressInterceptor is experimental and subject to change',
272 'ExperimentalWarning'
273 )
274 warningEmitted = true
275 }
276
277 return (dispatch) => {
278 return (opts, handler) => {
279 const decompressHandler = new DecompressHandler(handler, options)
280 return dispatch(opts, decompressHandler)
281 }
282 }
283}
284
285module.exports = createDecompressInterceptor

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.50

Tested by

no test coverage detected