@nestjs/websockets 8.2.4 → 8.2.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2021 Kamil Mysliwiec <https://kamilmysliwiec.com>
3
+ Copyright (c) 2017-2022 Kamil Mysliwiec <https://kamilmysliwiec.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -2,5 +2,4 @@ import { WsExceptionsHandler } from '../exceptions/ws-exceptions-handler';
2
2
  export declare class WsProxy {
3
3
  create(targetCallback: (...args: unknown[]) => Promise<any>, exceptionsHandler: WsExceptionsHandler): (...args: unknown[]) => Promise<any>;
4
4
  handleError<T>(exceptionsHandler: WsExceptionsHandler, args: unknown[], error: T): void;
5
- isObservable(result: any): boolean;
6
5
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WsProxy = void 0;
4
- const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
5
4
  const execution_context_host_1 = require("@nestjs/core/helpers/execution-context-host");
6
5
  const rxjs_1 = require("rxjs");
7
6
  const operators_1 = require("rxjs/operators");
@@ -10,11 +9,11 @@ class WsProxy {
10
9
  return async (...args) => {
11
10
  try {
12
11
  const result = await targetCallback(...args);
13
- return !this.isObservable(result)
12
+ return !rxjs_1.isObservable(result)
14
13
  ? result
15
14
  : result.pipe(operators_1.catchError(error => {
16
15
  this.handleError(exceptionsHandler, args, error);
17
- return rxjs_1.empty();
16
+ return rxjs_1.EMPTY;
18
17
  }));
19
18
  }
20
19
  catch (error) {
@@ -27,8 +26,5 @@ class WsProxy {
27
26
  host.setType('ws');
28
27
  exceptionsHandler.handle(error, host);
29
28
  }
30
- isObservable(result) {
31
- return result && shared_utils_1.isFunction(result.subscribe);
32
- }
33
29
  }
34
30
  exports.WsProxy = WsProxy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/websockets",
3
- "version": "8.2.4",
3
+ "version": "8.2.5",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -17,8 +17,8 @@
17
17
  "tslib": "2.3.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@nestjs/common": "8.2.4",
21
- "@nestjs/core": "8.2.4"
20
+ "@nestjs/common": "8.2.5",
21
+ "@nestjs/core": "8.2.5"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@nestjs/common": "^8.0.0",