Socket
Socket
Sign inDemoInstall

@feathersjs/transport-commons

Package Overview
Dependencies
Maintainers
4
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feathersjs/transport-commons - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

7

CHANGELOG.md
# Change Log
## [v4.1.0](https://github.com/feathersjs/transport-commons/tree/v4.1.0) (2018-06-28)
[Full Changelog](https://github.com/feathersjs/transport-commons/compare/v4.0.2...v4.1.0)
**Merged pull requests:**
- Remove empty channels [\#75](https://github.com/feathersjs/transport-commons/pull/75) ([daffl](https://github.com/daffl))
## [v4.0.2](https://github.com/feathersjs/transport-commons/tree/v4.0.2) (2018-06-12)

@@ -4,0 +11,0 @@ [Full Changelog](https://github.com/feathersjs/transport-commons/compare/v4.0.1...v4.0.2)

14

lib/socket/utils.js

@@ -33,3 +33,3 @@ const errors = require('@feathersjs/errors');

exports.getDispatcher = function (emit, socketKey) {
return function (event, channel, hook, data) {
return function (event, channel, context, data) {
debug(`Dispatching '${event}' to ${channel.length} connections`);

@@ -43,10 +43,10 @@

if (socket) {
const eventName = `${hook.path || ''} ${event}`.trim();
const eventName = `${context.path || ''} ${event}`.trim();
let result = channel.dataFor(connection) || hook.dispatch || hook.result;
let result = channel.dataFor(connection) || context.dispatch || context.result;
// If we are getting events from an array, try to get the individual
// item to dispatch from the correct index.
if (Array.isArray(hook.result) && Array.isArray(result)) {
result = result[hook.result.indexOf(data)];
// If we are getting events from an array but try to dispatch individual data
// try to get the individual item to dispatch from the correct index.
if (!Array.isArray(data) && Array.isArray(context.result) && Array.isArray(result)) {
result = result[context.result.indexOf(data)];
}

@@ -53,0 +53,0 @@

{
"name": "@feathersjs/transport-commons",
"description": "Shared functionality for websocket providers",
"version": "4.1.0",
"version": "4.1.1",
"homepage": "https://github.com/feathersjs/transport-commons",

@@ -6,0 +6,0 @@ "main": "lib/",

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