Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nestjs/websockets

Package Overview
Dependencies
Maintainers
1
Versions
342
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/websockets - npm Package Compare versions

Comparing version 5.4.1 to 5.5.0-0

4

context/ws-proxy.d.ts
import { WsExceptionsHandler } from '../exceptions/ws-exceptions-handler';
export declare class WsProxy {
create(targetCallback: (...args) => Promise<void>, exceptionsHandler: WsExceptionsHandler): (...args) => Promise<void>;
create(targetCallback: (...args) => Promise<any>, exceptionsHandler: WsExceptionsHandler): (...args) => Promise<any>;
handleError<T>(exceptionsHandler: WsExceptionsHandler, args: any[], error: T): void;
isObservable(result: any): boolean;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
const execution_context_host_1 = require("@nestjs/core/helpers/execution-context.host");
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
class WsProxy {

@@ -8,11 +11,23 @@ create(targetCallback, exceptionsHandler) {

try {
return await targetCallback(...args);
const result = await targetCallback(...args);
return !this.isObservable(result)
? result
: result.pipe(operators_1.catchError(error => {
this.handleError(exceptionsHandler, args, error);
return rxjs_1.empty();
}));
}
catch (e) {
const host = new execution_context_host_1.ExecutionContextHost(args);
exceptionsHandler.handle(e, host);
catch (error) {
this.handleError(exceptionsHandler, args, error);
}
};
}
handleError(exceptionsHandler, args, error) {
const host = new execution_context_host_1.ExecutionContextHost(args);
exceptionsHandler.handle(error, host);
}
isObservable(result) {
return result && shared_utils_1.isFunction(result.subscribe);
}
}
exports.WsProxy = WsProxy;
{
"name": "@nestjs/websockets",
"version": "5.4.1",
"version": "5.5.0-0",
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",

@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc