@seidor-cloud-produtos/orbit-backend-lib 0.0.63 → 0.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ export declare const compressionMiddleware: import('express').RequestHandler<
2
+ import('express-serve-static-core').ParamsDictionary,
3
+ any,
4
+ any,
5
+ import('qs').ParsedQs,
6
+ Record<string, any>
7
+ >;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.compressionMiddleware = void 0;
4
+ const tslib_1 = require('tslib');
5
+ const compression_1 = tslib_1.__importDefault(require('compression'));
6
+ const filter_1 = require('../../../infra/http/compression/filter');
7
+ exports.compressionMiddleware = (0, compression_1.default)({
8
+ filter: req => (0, filter_1.isToCompress)(req.headers),
9
+ });
@@ -0,0 +1,3 @@
1
+ export declare const isToCompress: (
2
+ headers: Record<string, string | string[] | undefined>,
3
+ ) => boolean;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.isToCompress = void 0;
4
+ const isToCompress = headers => {
5
+ return headers['accept-encoding'] === 'identity';
6
+ };
7
+ exports.isToCompress = isToCompress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",