@feathersjs/transport-commons
Advanced tools
Comparing version 4.1.0 to 4.1.1
# 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) |
@@ -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/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40152