wenay-common 1.0.165 → 1.0.166
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.
|
@@ -7,7 +7,10 @@ export type tRequestScreenerT<T> = {
|
|
|
7
7
|
callbacksId?: string[];
|
|
8
8
|
request: any[];
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type tt = {
|
|
11
|
+
[k: string]: any;
|
|
12
|
+
};
|
|
13
|
+
export declare function funcPromiseServer<T extends tt>(data: screenerSoc<tSocketData<tRequestScreenerT<T>>>, obj: T): void;
|
|
11
14
|
export declare function funcPromiseServer2<T extends object>(sendMessage: screenerSoc222<tSocketData<tRequestScreenerT<T>>>, obj: T): (datum: any) => Promise<void>;
|
|
12
15
|
type tSocketData<T> = ({
|
|
13
16
|
data: T;
|
|
@@ -28,12 +28,7 @@ function funcPromiseServer(data, obj) {
|
|
|
28
28
|
console.error({ error: e, key: key, arguments: request });
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (nameF == "call") {
|
|
32
|
-
console.log(key, nameF);
|
|
33
|
-
}
|
|
34
31
|
const buf = buf2;
|
|
35
|
-
if (!buf[nameF])
|
|
36
|
-
return;
|
|
37
32
|
if (typeof buf[nameF] == "function") {
|
|
38
33
|
const { callbacksId } = datum;
|
|
39
34
|
if (callbacksId) {
|
|
@@ -49,13 +44,12 @@ function funcPromiseServer(data, obj) {
|
|
|
49
44
|
});
|
|
50
45
|
let r = 0;
|
|
51
46
|
request.forEach((e, i) => {
|
|
52
|
-
if (e == "___FUNC")
|
|
47
|
+
if (e == "___FUNC")
|
|
53
48
|
request[i] = arr[r++];
|
|
54
|
-
}
|
|
55
49
|
});
|
|
56
50
|
}
|
|
57
51
|
const trt = async () => buf[nameF](...request);
|
|
58
|
-
|
|
52
|
+
await trt()
|
|
59
53
|
.then(a => {
|
|
60
54
|
if (datum.wait !== false)
|
|
61
55
|
data.sendMessage({ mapId: datum.mapId, data: a ?? undefined });
|
package/package.json
CHANGED