@powfix/core-js 0.13.32 → 0.13.34
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/dist/src/services/redis/RedisSubscriber.js +3 -2
- package/dist/src/utils/ArrayUtils.d.ts +1 -0
- package/dist/src/utils/ArrayUtils.js +4 -0
- package/dist/src/utils/global/castArray.d.ts +1 -0
- package/dist/src/utils/global/castArray.js +6 -0
- package/dist/src/utils/global/index.d.ts +1 -0
- package/dist/src/utils/global/index.js +1 -0
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArrayUtils = void 0;
|
|
4
|
+
const global_1 = require("./global");
|
|
4
5
|
class ArrayUtils {
|
|
6
|
+
static castArray(value) {
|
|
7
|
+
return (0, global_1.castArray)(value);
|
|
8
|
+
}
|
|
5
9
|
/**
|
|
6
10
|
* 객체를 요소로 가지는 배열에서 가장 큰 값(Property)를 가지는 객체를 반환한다
|
|
7
11
|
* @param e 객체 배열
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function castArray<T>(value: T | T[]): T[];
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./between"), exports);
|
|
18
|
+
__exportStar(require("./castArray"), exports);
|
|
18
19
|
__exportStar(require("./circularDistance"), exports);
|
|
19
20
|
__exportStar(require("./sleep"), exports);
|
|
20
21
|
__exportStar(require("./fallbackIfEqual"), exports);
|