wenay-common 1.0.25 → 1.0.29
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/lib/Common/commonsServer.d.ts +64 -0
- package/lib/Common/commonsServer.js +162 -0
- package/lib/Common/commonsServer.js.map +1 -0
- package/lib/client.d.ts +15 -0
- package/lib/client.js +39 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/lib/server.d.ts +2 -0
- package/lib/server.js +26 -0
- package/lib/server.js.map +1 -0
- package/package.json +18 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare function sleepAsync(msec?: number): Promise<unknown>;
|
|
2
|
+
export type tRequestScreenerT<T> = {
|
|
3
|
+
key: keyof T;
|
|
4
|
+
request: any;
|
|
5
|
+
};
|
|
6
|
+
export declare function funcPromiseServer<T extends object>(data: screenerSoc<tSocketData<tRequestScreenerT<T>>>, obj: T): void;
|
|
7
|
+
export declare function funcPromiseServer2<T extends object>(sendMessage: screenerSoc222<tSocketData<tRequestScreenerT<T>>>, obj: T): (datum: any) => Promise<void>;
|
|
8
|
+
export declare function funcPromiseServerPost<T extends object>(data: screenerPost<tRequestScreenerT<T>>, obj: T): void;
|
|
9
|
+
type tSocketData<T> = {
|
|
10
|
+
mapId: number;
|
|
11
|
+
data: T;
|
|
12
|
+
};
|
|
13
|
+
type screenerSoc<T> = {
|
|
14
|
+
sendMessage: (data: T) => void;
|
|
15
|
+
api: (data: {
|
|
16
|
+
onMessage: (data: T) => void | Promise<void>;
|
|
17
|
+
}) => void;
|
|
18
|
+
};
|
|
19
|
+
type screenerSoc222<T> = (data: T) => void;
|
|
20
|
+
type screenerPost<T> = {
|
|
21
|
+
api: (data: {
|
|
22
|
+
onMessage: (data: T) => any | Promise<any>;
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare function funcForWebSocket<T>(data: screenerSoc<tSocketData<tRequestScreenerT<T>>>): screenerSoc2<T>;
|
|
26
|
+
export declare function FFuncMyF<T extends object>(object: T): {
|
|
27
|
+
send: (data: tRequestScreenerT<T>) => Promise<any>;
|
|
28
|
+
};
|
|
29
|
+
export type screenerSoc2<T> = {
|
|
30
|
+
send: (data: tRequestScreenerT<T>, wait?: boolean) => Promise<any>;
|
|
31
|
+
};
|
|
32
|
+
export type tMethodToPromise2<T extends object> = {
|
|
33
|
+
[P in keyof T]: T[P] extends ((...args: infer Z) => infer X) ? (...args: Z) => (X extends Promise<any> ? X : Promise<X>) : Promise<T[P]>;
|
|
34
|
+
};
|
|
35
|
+
export declare function funcScreenerClient2<T extends object>(data: screenerSoc2<T>, callback?: boolean): tMethodToPromise2<T>;
|
|
36
|
+
type tAndB<T> = {
|
|
37
|
+
data: T;
|
|
38
|
+
void: () => void;
|
|
39
|
+
};
|
|
40
|
+
export type screenerSoc3<T> = {
|
|
41
|
+
send: (data: tRequestScreenerT<T>) => tAndB<Promise<any>>;
|
|
42
|
+
};
|
|
43
|
+
export type tMethodToPromise3<T extends object> = {
|
|
44
|
+
[P in keyof T]: T[P] extends ((...args: infer Z) => infer X) ? (...args: Z) => (X extends Promise<any> ? tAndB<X> : tAndB<Promise<X>>) : tAndB<Promise<T[P]>>;
|
|
45
|
+
};
|
|
46
|
+
export declare function funcScreenerClient3<T extends object>(data: screenerSoc3<T>): tMethodToPromise3<T>;
|
|
47
|
+
export type typeVoid2<T> = {
|
|
48
|
+
[P in Exclude<keyof T, {
|
|
49
|
+
[P in keyof T]: T[P] extends (any: any) => any ? ReturnType<T[P]> extends void ? P : never : never;
|
|
50
|
+
}[keyof T]>]: T[P];
|
|
51
|
+
};
|
|
52
|
+
export type typeNoVoid2<T> = {
|
|
53
|
+
[P in Exclude<keyof T, {
|
|
54
|
+
[P in keyof T]: T[P] extends (any: any) => any ? ReturnType<T[P]> extends void ? never : P : never;
|
|
55
|
+
}[keyof T]>]: T[P];
|
|
56
|
+
};
|
|
57
|
+
export declare function fMiniTest(): void;
|
|
58
|
+
export declare class CTestWeb {
|
|
59
|
+
func(a: number, b: number): number;
|
|
60
|
+
func2(a: number, b: number): Promise<number>;
|
|
61
|
+
fun3(a: number, b: number): number;
|
|
62
|
+
test(): string;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CTestWeb = exports.fMiniTest = exports.funcScreenerClient3 = exports.funcScreenerClient2 = exports.FFuncMyF = exports.funcForWebSocket = exports.funcPromiseServerPost = exports.funcPromiseServer2 = exports.funcPromiseServer = exports.sleepAsync = void 0;
|
|
4
|
+
async function sleepAsync(msec = 0) {
|
|
5
|
+
return new Promise((resolve, reject) => { setTimeout(resolve, msec); });
|
|
6
|
+
}
|
|
7
|
+
exports.sleepAsync = sleepAsync;
|
|
8
|
+
function funcPromiseServer(data, obj) {
|
|
9
|
+
data.api({
|
|
10
|
+
onMessage: async (datum) => {
|
|
11
|
+
const { key, request } = datum.data;
|
|
12
|
+
const buf = obj[key];
|
|
13
|
+
if (!buf)
|
|
14
|
+
return;
|
|
15
|
+
if (typeof buf == "function") {
|
|
16
|
+
const a = await (async () => buf(...request))();
|
|
17
|
+
data.sendMessage({ mapId: datum.mapId, data: a ?? undefined });
|
|
18
|
+
}
|
|
19
|
+
else
|
|
20
|
+
throw "это не функция";
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.funcPromiseServer = funcPromiseServer;
|
|
25
|
+
function funcPromiseServer2(sendMessage, obj) {
|
|
26
|
+
return async (datum) => {
|
|
27
|
+
const { key, request } = datum.data;
|
|
28
|
+
const buf = obj[key];
|
|
29
|
+
if (!buf)
|
|
30
|
+
return;
|
|
31
|
+
if (typeof buf == "function") {
|
|
32
|
+
const a = await (async () => buf(...request))();
|
|
33
|
+
sendMessage({ mapId: datum.mapId, data: a ?? undefined });
|
|
34
|
+
}
|
|
35
|
+
else
|
|
36
|
+
throw "это не функция";
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.funcPromiseServer2 = funcPromiseServer2;
|
|
40
|
+
function funcPromiseServerPost(data, obj) {
|
|
41
|
+
data.api({
|
|
42
|
+
onMessage: async (datum) => {
|
|
43
|
+
console.log(datum);
|
|
44
|
+
if (!datum)
|
|
45
|
+
return;
|
|
46
|
+
const { key, request } = datum;
|
|
47
|
+
if (!key)
|
|
48
|
+
return;
|
|
49
|
+
const buf = obj[key];
|
|
50
|
+
if (!buf)
|
|
51
|
+
return;
|
|
52
|
+
if (typeof buf == "function") {
|
|
53
|
+
const a = await (async () => buf(...request))();
|
|
54
|
+
return { data: a ?? undefined };
|
|
55
|
+
}
|
|
56
|
+
else
|
|
57
|
+
throw "это не функция";
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.funcPromiseServerPost = funcPromiseServerPost;
|
|
62
|
+
function funcForWebSocket(data) {
|
|
63
|
+
const sendMessage = (datum) => data.sendMessage(datum);
|
|
64
|
+
let d = 0;
|
|
65
|
+
const map = new Map();
|
|
66
|
+
const long = async (send, time) => {
|
|
67
|
+
await sleepAsync(5000);
|
|
68
|
+
if (map.has(send.mapId)) {
|
|
69
|
+
console.warn("подозрительно долгий ответ на запрос ", send.data);
|
|
70
|
+
if (Date.now() - time.valueOf() > 1000 * 60 * 5) {
|
|
71
|
+
console.error("прошло 5 минут, наверное пора упасть", send.data);
|
|
72
|
+
map.get(send.mapId)?.(undefined);
|
|
73
|
+
map.delete(send.mapId);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
long(send, time);
|
|
77
|
+
}
|
|
78
|
+
else
|
|
79
|
+
return;
|
|
80
|
+
};
|
|
81
|
+
data.api({
|
|
82
|
+
onMessage: (data) => {
|
|
83
|
+
console.log("onMessage ", data);
|
|
84
|
+
if (map.has(data.mapId)) {
|
|
85
|
+
const buf = map.get(data.mapId);
|
|
86
|
+
map.delete(data.mapId);
|
|
87
|
+
buf?.(data.data);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
send: (data, wait) => new Promise((resolve, reject) => {
|
|
93
|
+
const send = { mapId: ++d, data };
|
|
94
|
+
if (wait !== false) {
|
|
95
|
+
map.set(send.mapId, (data) => {
|
|
96
|
+
if (data == undefined)
|
|
97
|
+
reject();
|
|
98
|
+
resolve(data);
|
|
99
|
+
});
|
|
100
|
+
if (map.size > 0)
|
|
101
|
+
console.log("map.size = ", map.size);
|
|
102
|
+
}
|
|
103
|
+
sendMessage(send);
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
exports.funcForWebSocket = funcForWebSocket;
|
|
108
|
+
function FFuncMyF(object) {
|
|
109
|
+
return {
|
|
110
|
+
send: async (data) => {
|
|
111
|
+
const buf = object[data.key];
|
|
112
|
+
if (!buf)
|
|
113
|
+
throw "такого метода нет";
|
|
114
|
+
if (typeof buf == "function")
|
|
115
|
+
return buf(...data.request);
|
|
116
|
+
else
|
|
117
|
+
throw "это не функция";
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
exports.FFuncMyF = FFuncMyF;
|
|
122
|
+
function funcScreenerClient2(data, callback) {
|
|
123
|
+
return new Proxy({}, {
|
|
124
|
+
get(target, p, receiver) {
|
|
125
|
+
console.log(target);
|
|
126
|
+
console.log(p);
|
|
127
|
+
console.log(data);
|
|
128
|
+
const key = String(p);
|
|
129
|
+
return async (...argArray) => data.send({ key, request: argArray }, callback);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
exports.funcScreenerClient2 = funcScreenerClient2;
|
|
134
|
+
function funcScreenerClient3(data) {
|
|
135
|
+
return new Proxy({}, {
|
|
136
|
+
get(target, p, receiver) {
|
|
137
|
+
const key = String(p);
|
|
138
|
+
return (...argArray) => data.send({ key, request: argArray });
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
exports.funcScreenerClient3 = funcScreenerClient3;
|
|
143
|
+
function fMiniTest() {
|
|
144
|
+
}
|
|
145
|
+
exports.fMiniTest = fMiniTest;
|
|
146
|
+
class CTestWeb {
|
|
147
|
+
func(a, b) {
|
|
148
|
+
return a + b;
|
|
149
|
+
}
|
|
150
|
+
async func2(a, b) {
|
|
151
|
+
await sleepAsync(1000);
|
|
152
|
+
return a * b;
|
|
153
|
+
}
|
|
154
|
+
fun3(a, b) {
|
|
155
|
+
return a ** b;
|
|
156
|
+
}
|
|
157
|
+
test() {
|
|
158
|
+
return "status ok";
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.CTestWeb = CTestWeb;
|
|
162
|
+
//# sourceMappingURL=commonsServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonsServer.js","sourceRoot":"","sources":["../../src/Common/commonsServer.ts"],"names":[],"mappings":";;;AAQO,KAAK,UAAU,UAAU,CAAC,OAAa,CAAC;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAFD,gCAEC;AAiBD,SAAgB,iBAAiB,CAAmB,IAAqD,EAAE,GAAM;IAC7G,IAAI,CAAC,GAAG,CAAC;QACL,SAAS,EAAE,KAAK,EAAE,KAAK,EAAC,EAAE;YACtB,MAAM,EAAC,GAAG,EAAC,OAAO,EAAC,GAAG,KAAK,CAAC,IAAI,CAAA;YAChC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;YACpB,IAAI,CAAC,GAAG;gBAAE,OAAM;YAChB,IAAI,OAAO,GAAG,IAAI,UAAU,EAAE;gBAC1B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAG,EAAE,CAAA,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C,CAAQ,EAAE,CAAS;QACpB,OAAO,CAAC,GAAG,CAAC,CAAA;IAChB,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,CAAQ,EAAE,CAAS;QAC3B,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,CAAA;IAChB,CAAC;IACD,IAAI,CAAC,CAAQ,EAAE,CAAS;QACpB,OAAO,CAAC,IAAI,CAAC,CAAA;IACjB,CAAC;IAED,IAAI;QACA,OAAO,WAAW,CAAA;IACtB,CAAC;CACJ;AAfD,4BAeC"}
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./Common/Time";
|
|
2
|
+
export * from "./Common/Common";
|
|
3
|
+
export * from "./Common/Color";
|
|
4
|
+
export * from "./Common/ListNodeAnd";
|
|
5
|
+
export * from "./Common/Math";
|
|
6
|
+
export * from "./Exchange/ConnectData/Binance";
|
|
7
|
+
export * as BaseTypes from "./Common/BaseTypes";
|
|
8
|
+
export * as Common from "./Common/Common";
|
|
9
|
+
export * as Time from "./Common/Time";
|
|
10
|
+
export * as Color from "./Common/Color";
|
|
11
|
+
export * as ListNodeAnd from "./Common/ListNodeAnd";
|
|
12
|
+
export * as Math from "./Common/Math";
|
|
13
|
+
export * as List from "./Common/List";
|
|
14
|
+
export * as LoadCandles from "./Exchange/ConnectData/Binance";
|
|
15
|
+
export declare function test(): void;
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.test = exports.LoadCandles = exports.List = exports.Math = exports.ListNodeAnd = exports.Color = exports.Time = exports.Common = exports.BaseTypes = void 0;
|
|
18
|
+
__exportStar(require("./Common/Time"), exports);
|
|
19
|
+
__exportStar(require("./Common/Common"), exports);
|
|
20
|
+
__exportStar(require("./Common/Color"), exports);
|
|
21
|
+
__exportStar(require("./Common/ListNodeAnd"), exports);
|
|
22
|
+
__exportStar(require("./Common/Math"), exports);
|
|
23
|
+
__exportStar(require("./Exchange/ConnectData/Binance"), exports);
|
|
24
|
+
exports.BaseTypes = require("./Common/BaseTypes");
|
|
25
|
+
exports.Common = require("./Common/Common");
|
|
26
|
+
exports.Time = require("./Common/Time");
|
|
27
|
+
exports.Color = require("./Common/Color");
|
|
28
|
+
exports.ListNodeAnd = require("./Common/ListNodeAnd");
|
|
29
|
+
exports.Math = require("./Common/Math");
|
|
30
|
+
exports.List = require("./Common/List");
|
|
31
|
+
exports.LoadCandles = require("./Exchange/ConnectData/Binance");
|
|
32
|
+
const ListNodeAnd_1 = require("./Common/ListNodeAnd");
|
|
33
|
+
function test() {
|
|
34
|
+
const tt = new ListNodeAnd_1.CListNodeAnd();
|
|
35
|
+
console.log("test");
|
|
36
|
+
console.log("lalalal");
|
|
37
|
+
}
|
|
38
|
+
exports.test = test;
|
|
39
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAC9B,iEAA+C;AAE/C,kDAAgD;AAChD,4CAA0C;AAC1C,wCAAsC;AACtC,0CAAwC;AACxC,sDAAoD;AACpD,wCAAsC;AACtC,wCAAsC;AACtC,gEAA8D;AAE9D,sDAAkD;AAElD,SAAgB,IAAI;IAChB,MAAM,EAAE,GAAG,IAAI,0BAAY,EAAE,CAAA;IAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC1B,CAAC;AAJD,oBAIC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from "./Common/Common";
|
|
|
3
3
|
export * from "./Common/Color";
|
|
4
4
|
export * from "./Common/ListNodeAnd";
|
|
5
5
|
export * from "./Common/Math";
|
|
6
|
-
export * from "./Exchange/ConnectData/Binance";
|
|
7
6
|
export * as BaseTypes from "./Common/BaseTypes";
|
|
8
7
|
export * as Common from "./Common/Common";
|
|
9
8
|
export * as Time from "./Common/Time";
|
|
@@ -13,3 +12,5 @@ export * as Math from "./Common/Math";
|
|
|
13
12
|
export * as List from "./Common/List";
|
|
14
13
|
export * as LoadCandles from "./Exchange/ConnectData/Binance";
|
|
15
14
|
export declare function test(): void;
|
|
15
|
+
declare let myModule: any;
|
|
16
|
+
export { myModule };
|
package/lib/index.js
CHANGED
|
@@ -14,13 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.test = exports.LoadCandles = exports.List = exports.Math = exports.ListNodeAnd = exports.Color = exports.Time = exports.Common = exports.BaseTypes = void 0;
|
|
17
|
+
exports.myModule = exports.test = exports.LoadCandles = exports.List = exports.Math = exports.ListNodeAnd = exports.Color = exports.Time = exports.Common = exports.BaseTypes = void 0;
|
|
18
18
|
__exportStar(require("./Common/Time"), exports);
|
|
19
19
|
__exportStar(require("./Common/Common"), exports);
|
|
20
20
|
__exportStar(require("./Common/Color"), exports);
|
|
21
21
|
__exportStar(require("./Common/ListNodeAnd"), exports);
|
|
22
22
|
__exportStar(require("./Common/Math"), exports);
|
|
23
|
-
__exportStar(require("./Exchange/ConnectData/Binance"), exports);
|
|
24
23
|
exports.BaseTypes = require("./Common/BaseTypes");
|
|
25
24
|
exports.Common = require("./Common/Common");
|
|
26
25
|
exports.Time = require("./Common/Time");
|
|
@@ -36,4 +35,13 @@ function test() {
|
|
|
36
35
|
console.log("lalalal");
|
|
37
36
|
}
|
|
38
37
|
exports.test = test;
|
|
38
|
+
let myModule;
|
|
39
|
+
exports.myModule = myModule;
|
|
40
|
+
if (typeof process !== 'undefined' &&
|
|
41
|
+
process + '' === '[object process]') {
|
|
42
|
+
exports.myModule = myModule = Promise.resolve().then(() => require("./server"));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
exports.myModule = myModule = Promise.resolve().then(() => require("./client"));
|
|
46
|
+
}
|
|
39
47
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAeA,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAeA,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAE9B,kDAAgD;AAChD,4CAA0C;AAC1C,wCAAsC;AACtC,0CAAwC;AACxC,sDAAoD;AACpD,wCAAsC;AACtC,wCAAsC;AACtC,gEAA8D;AAE9D,sDAAkD;AAElD,SAAgB,IAAI;IAChB,MAAM,EAAE,GAAG,IAAI,0BAAY,EAAE,CAAA;IAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC1B,CAAC;AAJD,oBAIC;AAED,IAAI,QAAQ,CAAC;AAiBL,4BAAQ;AAZZ,IAAI,OAAO,OAAO,KAAK,WAAW;IAClC,OAAO,GAAG,EAAE,KAAK,kBAAkB,EAAE;IAEjC,mBAAA,QAAQ,wCAAU,UAAU,EAAC,CAAA;CAGpC;KAAM;IACC,mBAAA,QAAQ,wCAAU,UAAU,EAAC,CAAA;CAEhC"}
|
package/lib/server.d.ts
ADDED
package/lib/server.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.test = void 0;
|
|
18
|
+
__exportStar(require("./Exchange/ConnectData/Binance"), exports);
|
|
19
|
+
const ListNodeAnd_1 = require("./Common/ListNodeAnd");
|
|
20
|
+
function test() {
|
|
21
|
+
const tt = new ListNodeAnd_1.CListNodeAnd();
|
|
22
|
+
console.log("test");
|
|
23
|
+
console.log("lalalal");
|
|
24
|
+
}
|
|
25
|
+
exports.test = test;
|
|
26
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,iEAA+C;AAG/C,sDAAkD;AAElD,SAAgB,IAAI;IAChB,MAAM,EAAE,GAAG,IAAI,0BAAY,EAAE,CAAA;IAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC1B,CAAC;AAJD,oBAIC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wenay-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "math math math",
|
|
5
5
|
"strict": true,
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -39,6 +39,22 @@
|
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
41
|
"utf-8-validate": "^6.0.3"
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": {
|
|
46
|
+
"default": "./index.d.ts"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./client": {
|
|
50
|
+
"types": {
|
|
51
|
+
"default": "./client.d.ts"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./server": {
|
|
55
|
+
"types": {
|
|
56
|
+
"default": "./server.d.ts"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
42
59
|
}
|
|
43
|
-
|
|
44
60
|
}
|