@tramvai/module-request-limiter 5.9.2 → 5.14.9

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.
package/lib/server.es.js CHANGED
@@ -34,7 +34,6 @@ RequestLimiterModule = __decorate([
34
34
  provide: REQUESTS_LIMITER_TOKEN,
35
35
  scope: Scope.SINGLETON,
36
36
  useFactory: ({ options, featureEnable, envManager }) => {
37
- var _a, _b, _c, _d;
38
37
  if (featureEnable === false) {
39
38
  return;
40
39
  }
@@ -42,12 +41,12 @@ RequestLimiterModule = __decorate([
42
41
  const queue = envManager.get('REQUEST_LIMITER_QUEUE');
43
42
  const limit = envManager.get('REQUEST_LIMITER_LIMIT');
44
43
  const resultOptions = {
45
- limit: limit ? Number(limit) : (_a = options === null || options === void 0 ? void 0 : options.limit) !== null && _a !== void 0 ? _a : DEFAULT_OPTIONS.limit,
46
- queue: queue ? Number(queue) : (_b = options === null || options === void 0 ? void 0 : options.queue) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.queue,
44
+ limit: limit ? Number(limit) : options?.limit ?? DEFAULT_OPTIONS.limit,
45
+ queue: queue ? Number(queue) : options?.queue ?? DEFAULT_OPTIONS.queue,
47
46
  maxEventLoopDelay: meld
48
47
  ? Number(meld)
49
- : (_c = options === null || options === void 0 ? void 0 : options.maxEventLoopDelay) !== null && _c !== void 0 ? _c : DEFAULT_OPTIONS.maxEventLoopDelay,
50
- error: (_d = options === null || options === void 0 ? void 0 : options.error) !== null && _d !== void 0 ? _d : DEFAULT_OPTIONS.error,
48
+ : options?.maxEventLoopDelay ?? DEFAULT_OPTIONS.maxEventLoopDelay,
49
+ error: options?.error ?? DEFAULT_OPTIONS.error,
51
50
  };
52
51
  return new RequestLimiter(resultOptions);
53
52
  },
package/lib/server.js CHANGED
@@ -36,7 +36,6 @@ exports.RequestLimiterModule = tslib.__decorate([
36
36
  provide: tokens.REQUESTS_LIMITER_TOKEN,
37
37
  scope: core.Scope.SINGLETON,
38
38
  useFactory: ({ options, featureEnable, envManager }) => {
39
- var _a, _b, _c, _d;
40
39
  if (featureEnable === false) {
41
40
  return;
42
41
  }
@@ -44,12 +43,12 @@ exports.RequestLimiterModule = tslib.__decorate([
44
43
  const queue = envManager.get('REQUEST_LIMITER_QUEUE');
45
44
  const limit = envManager.get('REQUEST_LIMITER_LIMIT');
46
45
  const resultOptions = {
47
- limit: limit ? Number(limit) : (_a = options === null || options === void 0 ? void 0 : options.limit) !== null && _a !== void 0 ? _a : requestLimiter.DEFAULT_OPTIONS.limit,
48
- queue: queue ? Number(queue) : (_b = options === null || options === void 0 ? void 0 : options.queue) !== null && _b !== void 0 ? _b : requestLimiter.DEFAULT_OPTIONS.queue,
46
+ limit: limit ? Number(limit) : options?.limit ?? requestLimiter.DEFAULT_OPTIONS.limit,
47
+ queue: queue ? Number(queue) : options?.queue ?? requestLimiter.DEFAULT_OPTIONS.queue,
49
48
  maxEventLoopDelay: meld
50
49
  ? Number(meld)
51
- : (_c = options === null || options === void 0 ? void 0 : options.maxEventLoopDelay) !== null && _c !== void 0 ? _c : requestLimiter.DEFAULT_OPTIONS.maxEventLoopDelay,
52
- error: (_d = options === null || options === void 0 ? void 0 : options.error) !== null && _d !== void 0 ? _d : requestLimiter.DEFAULT_OPTIONS.error,
50
+ : options?.maxEventLoopDelay ?? requestLimiter.DEFAULT_OPTIONS.maxEventLoopDelay,
51
+ error: options?.error ?? requestLimiter.DEFAULT_OPTIONS.error,
53
52
  };
54
53
  return new requestLimiter.RequestLimiter(resultOptions);
55
54
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-request-limiter",
3
- "version": "5.9.2",
3
+ "version": "5.14.9",
4
4
  "description": "Enable different rendering modes for pages",
5
5
  "main": "lib/server.js",
6
6
  "module": "lib/server.es.js",
@@ -30,9 +30,9 @@
30
30
  "devDependencies": {},
31
31
  "peerDependencies": {
32
32
  "@tinkoff/dippy": "0.11.3",
33
- "@tramvai/core": "5.9.2",
34
- "@tramvai/tokens-common": "5.9.2",
35
- "@tramvai/tokens-server-private": "5.9.2",
33
+ "@tramvai/core": "5.14.9",
34
+ "@tramvai/tokens-common": "5.14.9",
35
+ "@tramvai/tokens-server-private": "5.14.9",
36
36
  "fastify": "^4.6.0",
37
37
  "tslib": "^2.4.0"
38
38
  }