* Creates a decompression interceptor for HTTP responses * @param {DecompressHandlerOptions} [options] - Options for the interceptor * @returns {Function} - Interceptor function
(options = {})
| 265 | * @returns {Function} - Interceptor function |
| 266 | */ |
| 267 | function 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 | |
| 285 | module.exports = createDecompressInterceptor |
nothing calls this directly
no test coverage detected