@powfix/core-js 0.13.33 → 0.13.35
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.
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RedisSubscriber = void 0;
|
|
13
13
|
const RedisClient_1 = require("./RedisClient");
|
|
14
|
+
const utils_1 = require("../../utils");
|
|
14
15
|
class RedisSubscriber extends RedisClient_1.RedisClient {
|
|
15
16
|
constructor(options) {
|
|
16
17
|
super(options);
|
|
@@ -18,7 +19,7 @@ class RedisSubscriber extends RedisClient_1.RedisClient {
|
|
|
18
19
|
}
|
|
19
20
|
subscribe(channels, listener, bufferMode) {
|
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
for (const channel of
|
|
22
|
+
for (const channel of (0, utils_1.castArray)(channels)) {
|
|
22
23
|
if ((/\*/g).test(channel)) {
|
|
23
24
|
yield this.client.pSubscribe(channel, listener, bufferMode);
|
|
24
25
|
}
|
|
@@ -30,7 +31,7 @@ class RedisSubscriber extends RedisClient_1.RedisClient {
|
|
|
30
31
|
}
|
|
31
32
|
unsubscribe(channels, listener, bufferMode) {
|
|
32
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
for (const channel of
|
|
34
|
+
for (const channel of (0, utils_1.castArray)(channels)) {
|
|
34
35
|
if ((/\*/g).test(channel)) {
|
|
35
36
|
yield this.client.pUnsubscribe(channel, listener, bufferMode);
|
|
36
37
|
}
|
|
@@ -4,7 +4,7 @@ exports.pureEnum = pureEnum;
|
|
|
4
4
|
exports.pureEnumKeys = pureEnumKeys;
|
|
5
5
|
exports.pureEnumValues = pureEnumValues;
|
|
6
6
|
function pureEnum(e) {
|
|
7
|
-
return Object.entries(e).filter(([key, value]) =>
|
|
7
|
+
return Object.entries(e).filter(([key, value]) => !/^-?\d+$/g.test(key) && typeof value !== 'function');
|
|
8
8
|
}
|
|
9
9
|
function pureEnumKeys(e) {
|
|
10
10
|
return pureEnum(e).map(([key]) => key);
|