@feathersjs/transport-commons 5.0.24 → 5.0.25
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/CHANGELOG.md +6 -0
- package/lib/channels/index.js +8 -3
- package/lib/channels/index.js.map +1 -1
- package/package.json +9 -9
- package/src/channels/index.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- Reduce usage of lodash ([#3455](https://github.com/feathersjs/feathers/issues/3455)) ([8ce807a](https://github.com/feathersjs/feathers/commit/8ce807a5ca53ff5b8d5107a0656c6329404e6e6c))
|
|
11
|
+
|
|
6
12
|
## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/lib/channels/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.CombinedChannel = exports.Channel = exports.channels = exports.keys = void 0;
|
|
4
7
|
const feathers_1 = require("@feathersjs/feathers");
|
|
5
8
|
const commons_1 = require("@feathersjs/commons");
|
|
6
|
-
const
|
|
9
|
+
const flattenDeep_1 = __importDefault(require("lodash/flattenDeep"));
|
|
7
10
|
const base_1 = require("./channel/base");
|
|
8
11
|
Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return base_1.Channel; } });
|
|
9
12
|
const combined_1 = require("./channel/combined");
|
|
@@ -51,14 +54,16 @@ function channels() {
|
|
|
51
54
|
// 4. App publisher for all events
|
|
52
55
|
appPublishers[mixins_1.keys.ALL_EVENTS] ||
|
|
53
56
|
// 5. No publisher
|
|
54
|
-
|
|
57
|
+
(() => { });
|
|
55
58
|
try {
|
|
56
59
|
Promise.resolve(publisher(data, hook))
|
|
57
60
|
.then((result) => {
|
|
58
61
|
if (!result) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
|
-
const results = Array.isArray(result)
|
|
64
|
+
const results = Array.isArray(result)
|
|
65
|
+
? (0, flattenDeep_1.default)(result).filter(Boolean)
|
|
66
|
+
: [result];
|
|
62
67
|
const channel = new combined_1.CombinedChannel(results);
|
|
63
68
|
if (channel && channel.length > 0) {
|
|
64
69
|
app.emit('publish', event, channel, hook, data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA0G;AAC1G,iDAAiD;AACjD,qEAA4C;AAC5C,yCAAwC;AAoH/B,wFApHA,cAAO,OAoHA;AAnHhB,iDAAoD;AAmHlC,gGAnHT,0BAAe,OAmHS;AAlHjC,qCAA2F;AAoClF,qFApC4B,aAAI,OAoC5B;AAjCb,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,wCAAwC,CAAC,CAAA;AACnE,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAI,CAAA;AAkCzB,SAAgB,QAAQ;IACtB,OAAO,CAAC,GAAgB,EAAE,EAAE;QAC1B,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YAC3E,OAAM;QACR,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAA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|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/transport-commons",
|
|
3
3
|
"description": "Shared functionality for websocket providers",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.25",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"types": "lib/",
|
|
@@ -54,21 +54,21 @@
|
|
|
54
54
|
"*.js"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@feathersjs/commons": "^5.0.
|
|
58
|
-
"@feathersjs/errors": "^5.0.
|
|
59
|
-
"@feathersjs/feathers": "^5.0.
|
|
60
|
-
"encodeurl": "^
|
|
57
|
+
"@feathersjs/commons": "^5.0.25",
|
|
58
|
+
"@feathersjs/errors": "^5.0.25",
|
|
59
|
+
"@feathersjs/feathers": "^5.0.25",
|
|
60
|
+
"encodeurl": "^2.0.0",
|
|
61
61
|
"lodash": "^4.17.21"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/encodeurl": "^1.0.2",
|
|
65
65
|
"@types/lodash": "^4.17.0",
|
|
66
66
|
"@types/mocha": "^10.0.6",
|
|
67
|
-
"@types/node": "^20.
|
|
68
|
-
"mocha": "^10.
|
|
67
|
+
"@types/node": "^20.12.8",
|
|
68
|
+
"mocha": "^10.4.0",
|
|
69
69
|
"shx": "^0.3.4",
|
|
70
70
|
"ts-node": "^10.9.2",
|
|
71
|
-
"typescript": "^5.4.
|
|
71
|
+
"typescript": "^5.4.5"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "01bc3339efd27df1b3e8d4f6a82152faf6c5ced3"
|
|
74
74
|
}
|
package/src/channels/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Application, FeathersService, RealTimeConnection, getServiceOptions } from '@feathersjs/feathers'
|
|
2
2
|
import { createDebug } from '@feathersjs/commons'
|
|
3
|
-
import
|
|
3
|
+
import flattenDeep from 'lodash/flattenDeep'
|
|
4
4
|
import { Channel } from './channel/base'
|
|
5
5
|
import { CombinedChannel } from './channel/combined'
|
|
6
6
|
import { channelMixin, publishMixin, keys, PublishMixin, Event, Publisher } from './mixins'
|
|
@@ -87,7 +87,7 @@ export function channels() {
|
|
|
87
87
|
// 4. App publisher for all events
|
|
88
88
|
appPublishers[keys.ALL_EVENTS] ||
|
|
89
89
|
// 5. No publisher
|
|
90
|
-
|
|
90
|
+
(() => {})
|
|
91
91
|
|
|
92
92
|
try {
|
|
93
93
|
Promise.resolve(publisher(data, hook))
|
|
@@ -96,7 +96,9 @@ export function channels() {
|
|
|
96
96
|
return
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const results = Array.isArray(result)
|
|
99
|
+
const results = Array.isArray(result)
|
|
100
|
+
? flattenDeep(result).filter(Boolean)
|
|
101
|
+
: ([result] as Channel[])
|
|
100
102
|
const channel = new CombinedChannel(results)
|
|
101
103
|
|
|
102
104
|
if (channel && channel.length > 0) {
|