wenay-common 1.0.154 → 1.0.155
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/ByteStream.d.ts +3 -3
- package/lib/Common/ByteStream.js +2 -2
- package/lib/Common/Color.js +7 -8
- package/lib/Common/Listen.d.ts +22 -3
- package/lib/Common/Listen.js +25 -9
- package/lib/Common/Math.js +2 -3
- package/lib/Common/Time.js +22 -22
- package/lib/Common/common.js +36 -37
- package/lib/Common/commonsServer.js +7 -7
- package/lib/Common/funcTimeWait.js +2 -2
- package/lib/Common/inputAutoStep.js +1 -2
- package/lib/Common/node_console.js +4 -5
- package/lib/Common/objectPath.js +4 -5
- package/lib/Common/waitRun.js +2 -3
- package/lib/Exchange/Bars.d.ts +1 -1
- package/lib/Exchange/Bars.js +3 -3
- package/lib/Exchange/CParams.js +9 -9
- package/lib/Exchange/ConnectData/Binance/commonOrder.js +1 -2
- package/lib/Exchange/ConnectData/Binance/marketD.d.ts +23 -34
- package/lib/Exchange/ConnectData/Binance/marketData.d.ts +0 -1
- package/lib/Exchange/ConnectData/Binance/marketData.js +6 -6
- package/lib/Exchange/ConnectData/Binance/order.d.ts +5 -5
- package/lib/Exchange/ConnectData/Binance/signatureCoder.js +1 -2
- package/lib/Exchange/ConnectData/Binance/use.d.ts +8 -8
- package/lib/Exchange/ConnectData/Binance/use.js +1 -2
- package/lib/Exchange/ConnectData/Binance.d.ts +3 -4
- package/lib/Exchange/ConnectData/Binance.js +20 -20
- package/lib/Exchange/ConnectData/test.js +1 -2
- package/lib/Exchange/LoadBase.d.ts +0 -1
- package/lib/Exchange/LoadBase.js +1 -2
- package/lib/client.js +2 -2
- package/lib/index.js +2 -2
- package/package.json +1 -1
|
@@ -58,7 +58,7 @@ declare class ByteStreamR_<throwable extends boolean> {
|
|
|
58
58
|
constructor(data: Readonly<ArrayBuffer | DataView>);
|
|
59
59
|
UpdateFrom(stream: Readonly<ByteStreamW>): void;
|
|
60
60
|
private __readNumber;
|
|
61
|
-
_readNumber(bytes: number, isInteger: boolean, isSigned?: boolean): throwable extends true ? number : number | null;
|
|
61
|
+
_readNumber(bytes: number, isInteger: boolean, isSigned?: boolean): (throwable extends true ? number : number | null);
|
|
62
62
|
noThrow(): ByteStreamR_<false>;
|
|
63
63
|
readInt8(): throwable extends true ? number : number | null;
|
|
64
64
|
readInt16(): throwable extends true ? number : number | null;
|
|
@@ -74,10 +74,10 @@ declare class ByteStreamR_<throwable extends boolean> {
|
|
|
74
74
|
readUint64(): throwable extends true ? number : number | null;
|
|
75
75
|
readFloat(): throwable extends true ? number : number | null;
|
|
76
76
|
readDouble(): throwable extends true ? number : number | null;
|
|
77
|
-
readBool(): throwable extends true ? boolean : boolean | null;
|
|
77
|
+
readBool(): (throwable extends true ? boolean : boolean | null);
|
|
78
78
|
readNumber(type: NumericTypes | Nullable<NumericTypes>): throwable extends true ? number : number | null;
|
|
79
79
|
readDate(): Date;
|
|
80
|
-
toType<T>(value: T): throwable extends true ? T : T | null;
|
|
80
|
+
toType<T>(value: T): (throwable extends true ? T : T | null);
|
|
81
81
|
protected _getReadFuncForNumeric<T extends NumericTypes | Nullable<NumericTypes>>(type: T): (stream: ByteStreamR_<throwable>) => throwable extends true ? number : T extends NumericTypes ? number : number | null;
|
|
82
82
|
readNullable<T>(reader: ReaderFromBytes<NonNullable<T>>): NonNullable<T> | null;
|
|
83
83
|
readArray<T>(func: (stream: ByteStreamR) => NonNullable<T>): T[];
|
package/lib/Common/ByteStream.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ByteStreamR = exports.ByteStreamW = exports.
|
|
3
|
+
exports.ByteStreamR = exports.ByteStreamW = exports.Nullable = void 0;
|
|
4
|
+
exports.nullable = nullable;
|
|
4
5
|
function createCopyOfBuffer(src, length = src.byteLength) {
|
|
5
6
|
let dst = new ArrayBuffer(length);
|
|
6
7
|
new Uint8Array(dst).set(new Uint8Array(src));
|
|
@@ -12,7 +13,6 @@ class Nullable {
|
|
|
12
13
|
}
|
|
13
14
|
exports.Nullable = Nullable;
|
|
14
15
|
function nullable(type) { return new Nullable(type); }
|
|
15
|
-
exports.nullable = nullable;
|
|
16
16
|
function __getNumericTypeInfo(type) {
|
|
17
17
|
switch (type) {
|
|
18
18
|
case "int8": return [1];
|
package/lib/Common/Color.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSimilarColors = exports.toColorString = exports.colorStringToRGBA = exports.colorGeneratorByCount = exports.colorGenerator2 = exports.colorGenerator = exports.rgb = void 0;
|
|
4
|
-
function rgb(red, green, blue) { return `rgb(${red},${green},${blue})`; }
|
|
5
3
|
exports.rgb = rgb;
|
|
4
|
+
exports.colorGenerator = colorGenerator;
|
|
5
|
+
exports.colorGenerator2 = colorGenerator2;
|
|
6
|
+
exports.colorGeneratorByCount = colorGeneratorByCount;
|
|
7
|
+
exports.colorStringToRGBA = colorStringToRGBA;
|
|
8
|
+
exports.toColorString = toColorString;
|
|
9
|
+
exports.isSimilarColors = isSimilarColors;
|
|
10
|
+
function rgb(red, green, blue) { return `rgb(${red},${green},${blue})`; }
|
|
6
11
|
function* colorGenerator(min = 0, max = 254) {
|
|
7
12
|
for (let step = Math.floor((max - min) / 2); step >= 1; step /= 2) {
|
|
8
13
|
let v = (max - min) / step;
|
|
@@ -16,7 +21,6 @@ function* colorGenerator(min = 0, max = 254) {
|
|
|
16
21
|
}
|
|
17
22
|
yield [-1, -1, -1];
|
|
18
23
|
}
|
|
19
|
-
exports.colorGenerator = colorGenerator;
|
|
20
24
|
function* colorGenerator2(data) {
|
|
21
25
|
const max = data?.max ?? 255;
|
|
22
26
|
const min = data?.min ?? 0;
|
|
@@ -62,7 +66,6 @@ function* colorGenerator2(data) {
|
|
|
62
66
|
}
|
|
63
67
|
yield [-1, -1, -1];
|
|
64
68
|
}
|
|
65
|
-
exports.colorGenerator2 = colorGenerator2;
|
|
66
69
|
function colorGeneratorByCount(value = 180, count = 100, index = 1) {
|
|
67
70
|
const step = Math.floor(value * 6 * index / count);
|
|
68
71
|
const p = Math.floor(step / value);
|
|
@@ -72,7 +75,6 @@ function colorGeneratorByCount(value = 180, count = 100, index = 1) {
|
|
|
72
75
|
const b = (p == 3 || p == 4) ? value : (p == 5) ? value - z : (p == 2) ? z : 0;
|
|
73
76
|
return `rgb(${r},${g},${b})`;
|
|
74
77
|
}
|
|
75
|
-
exports.colorGeneratorByCount = colorGeneratorByCount;
|
|
76
78
|
function colorStringToRGBA(str) {
|
|
77
79
|
let arr = str.match(/^rgb?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
78
80
|
if (!arr || arr[1] == null)
|
|
@@ -84,14 +86,11 @@ function colorStringToRGBA(str) {
|
|
|
84
86
|
a ??= 1;
|
|
85
87
|
return [r, g, b, a];
|
|
86
88
|
}
|
|
87
|
-
exports.colorStringToRGBA = colorStringToRGBA;
|
|
88
89
|
function toColorString(str) { if (colorStringToRGBA(str))
|
|
89
90
|
return str; throw `the string '${str}' is not valid 'rgb' or 'rgba' string`; }
|
|
90
|
-
exports.toColorString = toColorString;
|
|
91
91
|
function isSimilarColors(color1, color2, maxDelta = 32) {
|
|
92
92
|
let [r1, g1, b1] = typeof color1 == "string" ? colorStringToRGBA(color1) : color1;
|
|
93
93
|
let [r2, g2, b2] = typeof color2 == "string" ? colorStringToRGBA(color2) : color2;
|
|
94
94
|
let delta = Math.max(r1 - r2) + Math.max(g1 - g2) + Math.max(b1 - b2);
|
|
95
95
|
return delta <= maxDelta;
|
|
96
96
|
}
|
|
97
|
-
exports.isSimilarColors = isSimilarColors;
|
package/lib/Common/Listen.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare function funcListenBySocket2<Z extends any[] = any[]>(e: t1<Z>, {
|
|
|
25
25
|
readonly stop?: (x: tt) => any;
|
|
26
26
|
readonly paramsModify?: (...e: Parameters<tt>) => any[];
|
|
27
27
|
}): {
|
|
28
|
-
callback: (z: (a: Z[0]) => void) => void;
|
|
28
|
+
callback: (z: (...params: Parameters<(a: Z[0]) => void>) => void) => void;
|
|
29
29
|
removeCallback: () => boolean;
|
|
30
30
|
};
|
|
31
31
|
export declare function funcListenBySocket<Z extends any[] = any[]>(e: ReturnType<typeof funcListenCallback<Z>>, status: () => boolean): {
|
|
@@ -45,9 +45,28 @@ export declare function UseListen<T extends any[]>(data?: {
|
|
|
45
45
|
removeListen: (a: tr222<T> | null) => void;
|
|
46
46
|
count: () => number;
|
|
47
47
|
}];
|
|
48
|
+
type tDeepKeys<T, T2 extends object, T3 extends any> = {
|
|
49
|
+
[K in keyof T]: T[K] extends T2 ? T3 : T[K] extends object ? tDeepKeys<T[K], T2, T3> : T[K];
|
|
50
|
+
};
|
|
51
|
+
type obj = {
|
|
52
|
+
[k: string]: any;
|
|
53
|
+
};
|
|
54
|
+
export declare function CompareKeys<T extends obj, T2 extends obj>(obj1: T, obj2: T2): boolean;
|
|
55
|
+
export declare function DeepCompareKeys<T, T2 extends obj, T4, T3 extends (a: T2) => any>(obj1: T, obj2: T2, func: (a: T2) => T4): any;
|
|
56
|
+
export declare function deepModifyByListen<T>(obj: T, status: () => boolean): tDeepKeys<T, {
|
|
57
|
+
lastUpdate: () => Date | null;
|
|
58
|
+
lastUpdateMs: () => number | null;
|
|
59
|
+
isRun: () => boolean;
|
|
60
|
+
run: () => (() => void) | null;
|
|
61
|
+
close: () => void;
|
|
62
|
+
addListen: (a: tr222<any[]>) => () => void;
|
|
63
|
+
removeListen: (a: tr222<any[]> | null) => void;
|
|
64
|
+
count: () => number;
|
|
65
|
+
}, ReturnType<typeof funcListenBySocket1>>;
|
|
66
|
+
export declare const funcListenBySocketObj: typeof deepModifyByListen;
|
|
48
67
|
export declare function PromiseArrayListen<T extends any = unknown>(array: ((() => Promise<T>) | (() => any) | Promise<T>)[]): {
|
|
49
|
-
listenOk: (a: (data: T, i: number, countOk: number, countError: number, count: number) => any) => () => void;
|
|
50
|
-
listenError: (a: (error: any, i: number, countOk: number, countError: number, count: number) => any) => () => void;
|
|
68
|
+
listenOk: (a: (...d: [data: T, i: number, countOk: number, countError: number, count: number]) => any) => () => void;
|
|
69
|
+
listenError: (a: (...d: [error: any, i: number, countOk: number, countError: number, count: number]) => any) => () => void;
|
|
51
70
|
promise: {
|
|
52
71
|
all: () => Promise<((() => Promise<T>) | Awaited<T>)[]>;
|
|
53
72
|
allSettled: () => Promise<PromiseSettledResult<(() => Promise<T>) | Awaited<T>>[]>;
|
package/lib/Common/Listen.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.funcListenBySocketObj = exports.funcListenBySocket1 = void 0;
|
|
4
|
+
exports.funcListenCallback = funcListenCallback;
|
|
5
|
+
exports.funcListenBySocket3 = funcListenBySocket3;
|
|
6
|
+
exports.funcListenBySocket2 = funcListenBySocket2;
|
|
7
|
+
exports.funcListenBySocket = funcListenBySocket;
|
|
8
|
+
exports.UseListen = UseListen;
|
|
9
|
+
exports.CompareKeys = CompareKeys;
|
|
10
|
+
exports.DeepCompareKeys = DeepCompareKeys;
|
|
11
|
+
exports.deepModifyByListen = deepModifyByListen;
|
|
12
|
+
exports.PromiseArrayListen = PromiseArrayListen;
|
|
13
|
+
exports.socketBuffer3 = socketBuffer3;
|
|
14
|
+
exports.socketBufferBySnapshot = socketBufferBySnapshot;
|
|
4
15
|
function funcListenCallback(a, event) {
|
|
5
16
|
const obj = new Map;
|
|
6
17
|
let close = null;
|
|
@@ -28,11 +39,9 @@ function funcListenCallback(a, event) {
|
|
|
28
39
|
};
|
|
29
40
|
return api;
|
|
30
41
|
}
|
|
31
|
-
exports.funcListenCallback = funcListenCallback;
|
|
32
42
|
function funcListenBySocket3(e, z) {
|
|
33
43
|
return funcListenBySocket2(e, { ...z, stop: x => x("___STOP"), paramsModify: (...e) => [e[0]] });
|
|
34
44
|
}
|
|
35
|
-
exports.funcListenBySocket3 = funcListenBySocket3;
|
|
36
45
|
function funcListenBySocket2(e, { stop, setEventClose, status, paramsModify }) {
|
|
37
46
|
const { addListen, removeListen, count } = e;
|
|
38
47
|
const x = { x: null };
|
|
@@ -76,7 +85,6 @@ function funcListenBySocket2(e, { stop, setEventClose, status, paramsModify }) {
|
|
|
76
85
|
removeCallback
|
|
77
86
|
};
|
|
78
87
|
}
|
|
79
|
-
exports.funcListenBySocket2 = funcListenBySocket2;
|
|
80
88
|
function funcListenBySocket(e, status) {
|
|
81
89
|
const { addListen, removeListen, count } = e;
|
|
82
90
|
let x = null;
|
|
@@ -107,7 +115,6 @@ function funcListenBySocket(e, status) {
|
|
|
107
115
|
}
|
|
108
116
|
};
|
|
109
117
|
}
|
|
110
|
-
exports.funcListenBySocket = funcListenBySocket;
|
|
111
118
|
exports.funcListenBySocket1 = funcListenBySocket;
|
|
112
119
|
function UseListen(data) {
|
|
113
120
|
let t = null;
|
|
@@ -115,7 +122,19 @@ function UseListen(data) {
|
|
|
115
122
|
a.run();
|
|
116
123
|
return [(...e) => t?.(...e), a];
|
|
117
124
|
}
|
|
118
|
-
|
|
125
|
+
function CompareKeys(obj1, obj2) {
|
|
126
|
+
return (new Set([...Object.keys(obj1), ...Object.keys(obj2)])).size == Object.keys(obj2).length;
|
|
127
|
+
}
|
|
128
|
+
function DeepCompareKeys(obj1, obj2, func) {
|
|
129
|
+
return (Object.fromEntries(Object.entries(obj1).map(([k, v]) => {
|
|
130
|
+
return v instanceof Object ? CompareKeys(v, obj2) ? [k, func(v)] : [k, DeepCompareKeys(v, obj2, func)] : [k, v];
|
|
131
|
+
})));
|
|
132
|
+
}
|
|
133
|
+
function deepModifyByListen(obj, status) {
|
|
134
|
+
const l = UseListen()[1];
|
|
135
|
+
return DeepCompareKeys(obj, l, e => (0, exports.funcListenBySocket1)(e, status));
|
|
136
|
+
}
|
|
137
|
+
exports.funcListenBySocketObj = deepModifyByListen;
|
|
119
138
|
function PromiseArrayListen(array) {
|
|
120
139
|
let ok = 0, error = 0;
|
|
121
140
|
const count = array.length;
|
|
@@ -151,13 +170,11 @@ function PromiseArrayListen(array) {
|
|
|
151
170
|
}
|
|
152
171
|
};
|
|
153
172
|
}
|
|
154
|
-
exports.PromiseArrayListen = PromiseArrayListen;
|
|
155
173
|
function socketBuffer3(func, callbackMain, memo = {}) {
|
|
156
174
|
return (a, ...b) => func({ ...a, callback: (v) => { const z = callbackMain(v, memo); if (z)
|
|
157
175
|
a.callback(...z); }
|
|
158
176
|
}, ...b);
|
|
159
177
|
}
|
|
160
|
-
exports.socketBuffer3 = socketBuffer3;
|
|
161
178
|
function socketBufferBySnapshot({ func, memo = {}, callbackSave, snapshot }) {
|
|
162
179
|
let d = null;
|
|
163
180
|
const [callback, listenA] = UseListen({
|
|
@@ -183,4 +200,3 @@ function socketBufferBySnapshot({ func, memo = {}, callbackSave, snapshot }) {
|
|
|
183
200
|
};
|
|
184
201
|
return { run, snapshot: () => snapshot?.(memo), memo, listenA, connect, get disconnect() { return d; } };
|
|
185
202
|
}
|
|
186
|
-
exports.socketBufferBySnapshot = socketBufferBySnapshot;
|
package/lib/Common/Math.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CorrelationRollingByBuffer = CorrelationRollingByBuffer;
|
|
4
|
+
exports.CorrelationFunc = CorrelationFunc;
|
|
4
5
|
function CorrelationRollingByBuffer(data) {
|
|
5
6
|
let setting = { ...data };
|
|
6
7
|
const map = new Map();
|
|
@@ -19,7 +20,6 @@ function CorrelationRollingByBuffer(data) {
|
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
|
-
exports.CorrelationRollingByBuffer = CorrelationRollingByBuffer;
|
|
23
23
|
function CorrelationFunc(d1, d2, setting) {
|
|
24
24
|
const { min, pow, sqrt } = Math;
|
|
25
25
|
const { isNaN } = Number;
|
|
@@ -67,4 +67,3 @@ function CorrelationFunc(d1, d2, setting) {
|
|
|
67
67
|
const result = (mulSum - (sum1 * sum2 / c)) / dense;
|
|
68
68
|
return { corr: result, buffer: buf };
|
|
69
69
|
}
|
|
70
|
-
exports.CorrelationFunc = CorrelationFunc;
|
package/lib/Common/Time.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CDelayer = exports.Period = exports.PeriodSpan = exports.TF = exports.TIME_UNIT = exports.M1_MS = exports.H1_MS = exports.D1_MS = exports.W1_MS = exports.W1_S = exports.D1_S = exports.H1_S = void 0;
|
|
4
|
+
exports.timeToStr_hhmmss_ms = timeToStr_hhmmss_ms;
|
|
5
|
+
exports.timeToStr_hhmmss = timeToStr_hhmmss;
|
|
6
|
+
exports.timeToStr_yyyymmdd_hhmm = timeToStr_yyyymmdd_hhmm;
|
|
7
|
+
exports.timeToStr_yyyymmdd_hhmmss = timeToStr_yyyymmdd_hhmmss;
|
|
8
|
+
exports.timeToStr_yyyymmdd_hhmmss_ms = timeToStr_yyyymmdd_hhmmss_ms;
|
|
9
|
+
exports.timeLocalToStr_hhmmss = timeLocalToStr_hhmmss;
|
|
10
|
+
exports.timeLocalToStr_hhmmss_ms = timeLocalToStr_hhmmss_ms;
|
|
11
|
+
exports.timeLocalToStr_yyyymmdd = timeLocalToStr_yyyymmdd;
|
|
12
|
+
exports.timeLocalToStr_yyyymmdd_hhmm = timeLocalToStr_yyyymmdd_hhmm;
|
|
13
|
+
exports.timeLocalToStr_yyyymmdd_hhmmss = timeLocalToStr_yyyymmdd_hhmmss;
|
|
14
|
+
exports.timeLocalToStr_yyyymmdd_hhmmss_ms = timeLocalToStr_yyyymmdd_hhmmss_ms;
|
|
15
|
+
exports.timeToString_yyyymmdd_hhmm_offset = timeToString_yyyymmdd_hhmm_offset;
|
|
16
|
+
exports.timeToString_yyyymmdd_hhmmss_offset = timeToString_yyyymmdd_hhmmss_offset;
|
|
17
|
+
exports.convertDatesToStrings = convertDatesToStrings;
|
|
18
|
+
exports.toPrintObject = toPrintObject;
|
|
19
|
+
exports.durationToStr = durationToStr;
|
|
20
|
+
exports.durationToStrNullable = durationToStrNullable;
|
|
21
|
+
exports.durationToStr_h_mm_ss = durationToStr_h_mm_ss;
|
|
22
|
+
exports.durationToStr_h_mm_ss_ms = durationToStr_h_mm_ss_ms;
|
|
23
|
+
exports.MinTime = MinTime;
|
|
24
|
+
exports.MaxTime = MaxTime;
|
|
4
25
|
const common_1 = require("./common");
|
|
5
26
|
function GetEnumKeys(T) { return Object.keys(T).filter(k => isNaN(k)); }
|
|
6
27
|
{
|
|
@@ -260,31 +281,18 @@ exports.Period = Period;
|
|
|
260
281
|
function str2(n) { return n <= 9 ? '0' + n : '' + n; }
|
|
261
282
|
function str3(n) { return (n <= 9 ? '00' : n <= 99 ? '0' : '') + n; }
|
|
262
283
|
function timeToStr_hhmmss_ms(date) { return str2(date.getUTCHours()) + ":" + str2(date.getUTCMinutes()) + ":" + str2(date.getUTCSeconds()) + "." + str3(date.getUTCMilliseconds()); }
|
|
263
|
-
exports.timeToStr_hhmmss_ms = timeToStr_hhmmss_ms;
|
|
264
284
|
function timeToStr_hhmmss(date) { return str2(date.getUTCHours()) + ":" + str2(date.getUTCMinutes()) + ":" + str2(date.getUTCSeconds()); }
|
|
265
|
-
exports.timeToStr_hhmmss = timeToStr_hhmmss;
|
|
266
285
|
function timeToStr_yyyymmdd_hhmm(date, dateDelim = "-") { return date.getUTCFullYear() + dateDelim + str2(date.getUTCMonth() + 1) + dateDelim + str2(date.getUTCDate()) + " " + str2(date.getUTCHours()) + ":" + str2(date.getUTCMinutes()); }
|
|
267
|
-
exports.timeToStr_yyyymmdd_hhmm = timeToStr_yyyymmdd_hhmm;
|
|
268
286
|
function timeToStr_yyyymmdd_hhmmss(date, dateDelim = "-") { return timeToStr_yyyymmdd_hhmm(date, dateDelim) + ":" + str2(date.getUTCSeconds()); }
|
|
269
|
-
exports.timeToStr_yyyymmdd_hhmmss = timeToStr_yyyymmdd_hhmmss;
|
|
270
287
|
function timeToStr_yyyymmdd_hhmmss_ms(date, dateDelim = "-") { return timeToStr_yyyymmdd_hhmmss(date, dateDelim) + "." + str3(date.getUTCMilliseconds()); }
|
|
271
|
-
exports.timeToStr_yyyymmdd_hhmmss_ms = timeToStr_yyyymmdd_hhmmss_ms;
|
|
272
288
|
function timeLocalToStr_hhmmss(date) { return str2(date.getHours()) + ":" + str2(date.getMinutes()) + ":" + str2(date.getSeconds()); }
|
|
273
|
-
exports.timeLocalToStr_hhmmss = timeLocalToStr_hhmmss;
|
|
274
289
|
function timeLocalToStr_hhmmss_ms(date) { return timeLocalToStr_hhmmss(date) + str3(date.getMilliseconds()); }
|
|
275
|
-
exports.timeLocalToStr_hhmmss_ms = timeLocalToStr_hhmmss_ms;
|
|
276
290
|
function timeLocalToStr_yyyymmdd(date, dateDelim = "-") { return date.getFullYear() + dateDelim + str2(date.getMonth() + 1) + dateDelim + str2(date.getDate()); }
|
|
277
|
-
exports.timeLocalToStr_yyyymmdd = timeLocalToStr_yyyymmdd;
|
|
278
291
|
function timeLocalToStr_yyyymmdd_hhmm(date, dateDelim = "-") { return timeLocalToStr_yyyymmdd(date, dateDelim) + " " + str2(date.getHours()) + ":" + str2(date.getMinutes()); }
|
|
279
|
-
exports.timeLocalToStr_yyyymmdd_hhmm = timeLocalToStr_yyyymmdd_hhmm;
|
|
280
292
|
function timeLocalToStr_yyyymmdd_hhmmss(date, dateDelim = "-") { return timeLocalToStr_yyyymmdd_hhmm(date, dateDelim) + ":" + str2(date.getSeconds()); }
|
|
281
|
-
exports.timeLocalToStr_yyyymmdd_hhmmss = timeLocalToStr_yyyymmdd_hhmmss;
|
|
282
293
|
function timeLocalToStr_yyyymmdd_hhmmss_ms(date, dateDelim = "-") { return timeLocalToStr_yyyymmdd_hhmmss(date, dateDelim) + "." + str3(date.getMilliseconds()); }
|
|
283
|
-
exports.timeLocalToStr_yyyymmdd_hhmmss_ms = timeLocalToStr_yyyymmdd_hhmmss_ms;
|
|
284
294
|
function timeToString_yyyymmdd_hhmm_offset(date) { let offset = date.getTimezoneOffset(); return timeLocalToStr_yyyymmdd_hhmm(date) + " GMT" + (offset < 0 ? '+' : '') + (-offset / 60); }
|
|
285
|
-
exports.timeToString_yyyymmdd_hhmm_offset = timeToString_yyyymmdd_hhmm_offset;
|
|
286
295
|
function timeToString_yyyymmdd_hhmmss_offset(date) { let offset = date.getTimezoneOffset(); return timeLocalToStr_yyyymmdd_hhmmss(date) + " GMT" + (offset < 0 ? '+' : '') + (-offset / 60); }
|
|
287
|
-
exports.timeToString_yyyymmdd_hhmmss_offset = timeToString_yyyymmdd_hhmmss_offset;
|
|
288
296
|
Date.prototype.toString = function () { return timeToString_yyyymmdd_hhmmss_offset(this); };
|
|
289
297
|
Date.prototype.toDateString = function () { return timeLocalToStr_yyyymmdd(this); };
|
|
290
298
|
Date.prototype.toTimeString = function () { let offset = this.getTimezoneOffset(); return timeLocalToStr_hhmmss(this) + " GMT" + (offset < 0 ? '+' : '') + (-offset / 60); };
|
|
@@ -311,9 +319,7 @@ function _getStructCopyWithTimeStrings(arg, objectsMap) {
|
|
|
311
319
|
return clone;
|
|
312
320
|
}
|
|
313
321
|
function convertDatesToStrings(arg) { return _getStructCopyWithTimeStrings(arg); }
|
|
314
|
-
exports.convertDatesToStrings = convertDatesToStrings;
|
|
315
322
|
function toPrintObject(arg) { return convertDatesToStrings(arg); }
|
|
316
|
-
exports.toPrintObject = toPrintObject;
|
|
317
323
|
function replaceConsoleCommands() {
|
|
318
324
|
const consoleLog = console.log;
|
|
319
325
|
const consoleWarn = console.warn;
|
|
@@ -346,16 +352,12 @@ function durationToStr(duration_ms) {
|
|
|
346
352
|
}
|
|
347
353
|
return str;
|
|
348
354
|
}
|
|
349
|
-
exports.durationToStr = durationToStr;
|
|
350
355
|
function durationToStrNullable(duration_ms) { return duration_ms == null ? null : durationToStr(duration_ms); }
|
|
351
|
-
exports.durationToStrNullable = durationToStrNullable;
|
|
352
356
|
function durationToStr_h_mm_ss(duration_ms) {
|
|
353
357
|
let time = new Date(duration_ms);
|
|
354
358
|
return Math.trunc(duration_ms / exports.H1_MS) + ":" + str2(time.getUTCMinutes()) + ":" + str2(time.getUTCSeconds());
|
|
355
359
|
}
|
|
356
|
-
exports.durationToStr_h_mm_ss = durationToStr_h_mm_ss;
|
|
357
360
|
function durationToStr_h_mm_ss_ms(duration_ms) { return durationToStr_h_mm_ss(duration_ms) + "." + str3(Math.trunc(duration_ms % 1000)); }
|
|
358
|
-
exports.durationToStr_h_mm_ss_ms = durationToStr_h_mm_ss_ms;
|
|
359
361
|
async function sleepAsync(msec) {
|
|
360
362
|
return new Promise((resolve, reject) => { setTimeout(resolve, msec); });
|
|
361
363
|
}
|
|
@@ -386,8 +388,6 @@ exports.CDelayer = CDelayer;
|
|
|
386
388
|
function MinTime(time1, time2) {
|
|
387
389
|
return time1 && time2 && time1.valueOf() <= time2.valueOf() ? time1 : time2 ?? time1;
|
|
388
390
|
}
|
|
389
|
-
exports.MinTime = MinTime;
|
|
390
391
|
function MaxTime(time1, time2) {
|
|
391
392
|
return time1 && time2 && time1.valueOf() >= time2.valueOf() ? time1 : time2 ?? time1;
|
|
392
393
|
}
|
|
393
|
-
exports.MaxTime = MaxTime;
|
package/lib/Common/common.js
CHANGED
|
@@ -23,15 +23,47 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.CCachedValue2 = exports.CCachedValueT = exports.WeakMapExt = exports.MapExt = exports.CObjectID = exports.Mutex = exports.MyTimerInterval = exports.CancelablePromise = exports.CancelToken = exports.VirtualItems = exports.ArraySet = exports.ArrayMap = exports.StructSet = exports.StructMap = exports.MyNumMap = exports.MyMap = exports.__MyMap = exports.BSearchAsync = exports.E_MATCH = exports.E_SORTMODE = exports.CBase = void 0;
|
|
27
|
+
exports.GetEnumKeys = GetEnumKeys;
|
|
28
|
+
exports.isDate = isDate;
|
|
29
|
+
exports.shallowClone = shallowClone;
|
|
30
|
+
exports._deepClone = _deepClone;
|
|
31
|
+
exports.deepClone = deepClone;
|
|
32
|
+
exports.deepCloneMutable = deepCloneMutable;
|
|
33
|
+
exports.deepCloneObject = deepCloneObject;
|
|
34
|
+
exports.deepCloneObjectMutable = deepCloneObjectMutable;
|
|
35
|
+
exports.toImmutable = toImmutable;
|
|
36
|
+
exports.readonlyFull = readonlyFull;
|
|
37
|
+
exports.deepEqual = deepEqual;
|
|
38
|
+
exports.shallowEqual = shallowEqual;
|
|
39
|
+
exports.arrayShallowEqual = arrayShallowEqual;
|
|
40
|
+
exports.sleepAsync = sleepAsync;
|
|
41
|
+
exports.BSearch = BSearch;
|
|
42
|
+
exports.BSearchDefault = BSearchDefault;
|
|
43
|
+
exports.BSearchIndex = BSearchIndex;
|
|
44
|
+
exports.BSearchValueInRange = BSearchValueInRange;
|
|
45
|
+
exports.BSearchNearest = BSearchNearest;
|
|
46
|
+
exports._BSearchNearest = _BSearchNearest;
|
|
47
|
+
exports.NormalizeDouble = NormalizeDouble;
|
|
48
|
+
exports.MaxCommonDivisor = MaxCommonDivisor;
|
|
49
|
+
exports.MaxCommonDivisorOnArray = MaxCommonDivisorOnArray;
|
|
50
|
+
exports.GetDblPrecision2 = GetDblPrecision2;
|
|
51
|
+
exports.GetDblPrecision = GetDblPrecision;
|
|
52
|
+
exports.DblToStrAuto = DblToStrAuto;
|
|
53
|
+
exports.NormalizeDoubleAnd = NormalizeDoubleAnd;
|
|
54
|
+
exports.DblToStrAnd = DblToStrAnd;
|
|
55
|
+
exports.ArrayItemHandler = ArrayItemHandler;
|
|
56
|
+
exports.CreateArrayProxy = CreateArrayProxy;
|
|
57
|
+
exports.JSON_clone = JSON_clone;
|
|
58
|
+
exports.createCancellableTimer = createCancellableTimer;
|
|
59
|
+
exports.createCancellableTaskWrapper = createCancellableTaskWrapper;
|
|
60
|
+
exports.copyToClipboard = copyToClipboard;
|
|
61
|
+
exports.isObjectCastableTo = isObjectCastableTo;
|
|
28
62
|
require("./node_console");
|
|
29
63
|
function GetEnumKeys(T) { return Object.keys(T).filter(k => isNaN(k)); }
|
|
30
|
-
exports.GetEnumKeys = GetEnumKeys;
|
|
31
64
|
function isDate(value) {
|
|
32
65
|
return value instanceof Date;
|
|
33
66
|
}
|
|
34
|
-
exports.isDate = isDate;
|
|
35
67
|
{
|
|
36
68
|
let aaa;
|
|
37
69
|
let bbb;
|
|
@@ -50,7 +82,6 @@ function shallowClone(val) {
|
|
|
50
82
|
return Array.isArray(val) ? Object.assign([], { ...val })
|
|
51
83
|
: typeof val == "object" && val ? { ...val } : val;
|
|
52
84
|
}
|
|
53
|
-
exports.shallowClone = shallowClone;
|
|
54
85
|
function _deepClone(src, map) {
|
|
55
86
|
if (!src || typeof src != "object")
|
|
56
87
|
return src;
|
|
@@ -83,26 +114,19 @@ function _deepClone(src, map) {
|
|
|
83
114
|
}
|
|
84
115
|
return newobject;
|
|
85
116
|
}
|
|
86
|
-
exports._deepClone = _deepClone;
|
|
87
117
|
function deepClone(object) { return _deepClone(object); }
|
|
88
|
-
exports.deepClone = deepClone;
|
|
89
118
|
function deepCloneMutable(value) { return deepClone(value); }
|
|
90
|
-
exports.deepCloneMutable = deepCloneMutable;
|
|
91
119
|
function deepCloneObject(object) {
|
|
92
120
|
if (object == undefined)
|
|
93
121
|
throw new Error("object is undefined!");
|
|
94
122
|
return deepClone(object);
|
|
95
123
|
}
|
|
96
|
-
exports.deepCloneObject = deepCloneObject;
|
|
97
124
|
function deepCloneObjectMutable(object) { return deepCloneObject(object); }
|
|
98
|
-
exports.deepCloneObjectMutable = deepCloneObjectMutable;
|
|
99
125
|
function toImmutable(object) {
|
|
100
126
|
return object.Mutable == false ? object
|
|
101
127
|
: Object.freeze(Object.assign(deepCloneObject(object), { Mutable: false }));
|
|
102
128
|
}
|
|
103
|
-
exports.toImmutable = toImmutable;
|
|
104
129
|
function readonlyFull(arg) { return arg; }
|
|
105
|
-
exports.readonlyFull = readonlyFull;
|
|
106
130
|
function deepEqual(object1, object2) {
|
|
107
131
|
if (object1 == object2)
|
|
108
132
|
return true;
|
|
@@ -121,7 +145,6 @@ function deepEqual(object1, object2) {
|
|
|
121
145
|
}
|
|
122
146
|
return true;
|
|
123
147
|
}
|
|
124
|
-
exports.deepEqual = deepEqual;
|
|
125
148
|
function shallowEqual(object1, object2) {
|
|
126
149
|
if (!object1 || !object2)
|
|
127
150
|
return object1 == object2;
|
|
@@ -138,17 +161,14 @@ function shallowEqual(object1, object2) {
|
|
|
138
161
|
}
|
|
139
162
|
return true;
|
|
140
163
|
}
|
|
141
|
-
exports.shallowEqual = shallowEqual;
|
|
142
164
|
function arrayShallowEqual(arr1, arr2) {
|
|
143
165
|
if (arr1.length != arr2.length)
|
|
144
166
|
return false;
|
|
145
167
|
return arr1.every((item, i) => arr2[i] == item);
|
|
146
168
|
}
|
|
147
|
-
exports.arrayShallowEqual = arrayShallowEqual;
|
|
148
169
|
async function sleepAsync(msec = 0) {
|
|
149
170
|
return new Promise((resolve, reject) => { setTimeout(resolve, msec); });
|
|
150
171
|
}
|
|
151
|
-
exports.sleepAsync = sleepAsync;
|
|
152
172
|
class CBase {
|
|
153
173
|
}
|
|
154
174
|
exports.CBase = CBase;
|
|
@@ -169,13 +189,11 @@ function BSearch(array, arg2, arg3, ...args) {
|
|
|
169
189
|
typeof (arg2) == "function" ? ___BSearch(array, arg2, arg3, ...args) :
|
|
170
190
|
BSearchDefault(array, arg2, arg3, ...args);
|
|
171
191
|
}
|
|
172
|
-
exports.BSearch = BSearch;
|
|
173
192
|
const BSearchAsync = (...a) => ___BSearchAsync(...a);
|
|
174
193
|
exports.BSearchAsync = BSearchAsync;
|
|
175
194
|
function BSearchDefault(array, value, match, mode) {
|
|
176
195
|
return __BSearch(array, value, (a, b) => Math.sign(a.valueOf() - b.valueOf()), match, mode);
|
|
177
196
|
}
|
|
178
|
-
exports.BSearchDefault = BSearchDefault;
|
|
179
197
|
function __BSearch(array, value, comparer, matchMode, sortMode) {
|
|
180
198
|
return ___BSearch(array, (item) => comparer(item, value), matchMode, sortMode);
|
|
181
199
|
}
|
|
@@ -255,7 +273,6 @@ function BSearchIndex(length, compareIndex, matchMode, sortMode) {
|
|
|
255
273
|
i = -1;
|
|
256
274
|
return i;
|
|
257
275
|
}
|
|
258
|
-
exports.BSearchIndex = BSearchIndex;
|
|
259
276
|
function ___BSearch(array, compareItemToValue, matchMode, sortMode) {
|
|
260
277
|
return BSearchIndex(array.length, (i) => compareItemToValue(array[i]), matchMode, sortMode);
|
|
261
278
|
}
|
|
@@ -270,7 +287,6 @@ function BSearchValueInRange(from, to, precision, compare, matchMode) {
|
|
|
270
287
|
return null;
|
|
271
288
|
return from + precision * i;
|
|
272
289
|
}
|
|
273
|
-
exports.BSearchValueInRange = BSearchValueInRange;
|
|
274
290
|
BSearch.EQUAL = E_MATCH.EQUAL;
|
|
275
291
|
BSearch.LESS_OR_EQUAL = E_MATCH.LESS_OR_EQUAL;
|
|
276
292
|
BSearch.GREAT_OR_EQUAL = E_MATCH.GREAT_OR_EQUAL;
|
|
@@ -278,7 +294,6 @@ function BSearchNearest(array, searchValue, getterOrDelta, maxDeltaOrNull) {
|
|
|
278
294
|
let [getter, maxDelta] = typeof getterOrDelta == "function" ? [getterOrDelta, maxDeltaOrNull] : [(elem) => elem, getterOrDelta];
|
|
279
295
|
return _BSearchNearest(array, searchValue, getter, maxDelta);
|
|
280
296
|
}
|
|
281
|
-
exports.BSearchNearest = BSearchNearest;
|
|
282
297
|
function _BSearchNearest(array, searchValue, arrayGetValue, maxDelta) {
|
|
283
298
|
if (array.length == 0)
|
|
284
299
|
return -1;
|
|
@@ -300,9 +315,7 @@ function _BSearchNearest(array, searchValue, arrayGetValue, maxDelta) {
|
|
|
300
315
|
}
|
|
301
316
|
return index;
|
|
302
317
|
}
|
|
303
|
-
exports._BSearchNearest = _BSearchNearest;
|
|
304
318
|
function NormalizeDouble(value, digits) { let factor = 10 ** digits; return Math.round(value * factor) / factor; }
|
|
305
|
-
exports.NormalizeDouble = NormalizeDouble;
|
|
306
319
|
function fabs(value) { return Math.abs(value); }
|
|
307
320
|
function round(value) { return Math.round(value); }
|
|
308
321
|
function __GetMaxCommonDivisor(a, b, digits) {
|
|
@@ -342,7 +355,6 @@ function MaxCommonDivisor(a, b, digits = 8) {
|
|
|
342
355
|
else
|
|
343
356
|
return __GetMaxCommonDivisor(b, a, digits);
|
|
344
357
|
}
|
|
345
|
-
exports.MaxCommonDivisor = MaxCommonDivisor;
|
|
346
358
|
function MaxCommonDivisorOnArray(values, precisDigits = 8) {
|
|
347
359
|
let divis = 0;
|
|
348
360
|
for (let value of values) {
|
|
@@ -350,7 +362,6 @@ function MaxCommonDivisorOnArray(values, precisDigits = 8) {
|
|
|
350
362
|
}
|
|
351
363
|
return divis;
|
|
352
364
|
}
|
|
353
|
-
exports.MaxCommonDivisorOnArray = MaxCommonDivisorOnArray;
|
|
354
365
|
function GetDblPrecision2(value, mindigits, maxdigits) {
|
|
355
366
|
maxdigits = Math.min(maxdigits, 16);
|
|
356
367
|
let epsilon = Math.pow(0.1, maxdigits + 1);
|
|
@@ -363,10 +374,8 @@ function GetDblPrecision2(value, mindigits, maxdigits) {
|
|
|
363
374
|
throw new Error("wrong digits: value=" + value + " mindigits=" + mindigits + " maxdigits=" + maxdigits);
|
|
364
375
|
return d;
|
|
365
376
|
}
|
|
366
|
-
exports.GetDblPrecision2 = GetDblPrecision2;
|
|
367
377
|
;
|
|
368
378
|
function GetDblPrecision(value, maxdigits = 8) { return GetDblPrecision2(value, 0, maxdigits); }
|
|
369
|
-
exports.GetDblPrecision = GetDblPrecision;
|
|
370
379
|
function DblToStrAuto2(value, minprecis, maxprecis) { return value?.toFixed(GetDblPrecision2(value, minprecis, maxprecis)); }
|
|
371
380
|
function DblToStrAuto(value, maxprecis = 8) {
|
|
372
381
|
let digits = maxprecis;
|
|
@@ -377,7 +386,6 @@ function DblToStrAuto(value, maxprecis = 8) {
|
|
|
377
386
|
maxprecis = 0;
|
|
378
387
|
return DblToStrAuto2(value, 0, maxprecis);
|
|
379
388
|
}
|
|
380
|
-
exports.DblToStrAuto = DblToStrAuto;
|
|
381
389
|
function NormalizeDoubleAnd(a, options) {
|
|
382
390
|
if (a == 0)
|
|
383
391
|
return a;
|
|
@@ -396,7 +404,6 @@ function NormalizeDoubleAnd(a, options) {
|
|
|
396
404
|
return func(a / (10 ** (k - w))) * (10 ** (k - w));
|
|
397
405
|
return func(a / (10 ** (k - w))) * (10 ** (k - w));
|
|
398
406
|
}
|
|
399
|
-
exports.NormalizeDoubleAnd = NormalizeDoubleAnd;
|
|
400
407
|
function DblToStrAnd(a, options) {
|
|
401
408
|
let { digitsPoint: w = 4, digitsR: r } = options ?? {};
|
|
402
409
|
if (!r && a % 1.0 == 0)
|
|
@@ -414,7 +421,6 @@ function DblToStrAnd(a, options) {
|
|
|
414
421
|
return (func(a / (10 ** (k - w + 1))) * (10 ** (k - w + 1))).toString();
|
|
415
422
|
return (func(a / (10 ** (k - w + 1))) * (10 ** (k - w + 1))).toFixed(w - k - 1);
|
|
416
423
|
}
|
|
417
|
-
exports.DblToStrAnd = DblToStrAnd;
|
|
418
424
|
function testDblToStrAnd() {
|
|
419
425
|
const r = 0.047952487787;
|
|
420
426
|
for (let i = -10; i < 10; i++) {
|
|
@@ -453,13 +459,11 @@ function ArrayItemHandler(getter, setter) {
|
|
|
453
459
|
}
|
|
454
460
|
};
|
|
455
461
|
}
|
|
456
|
-
exports.ArrayItemHandler = ArrayItemHandler;
|
|
457
462
|
function CreateArrayProxy(target, getterOrArray, setter) {
|
|
458
463
|
if (typeof getterOrArray == "object")
|
|
459
464
|
return CreateArrayProxy(target, (i) => getterOrArray[i], (i, val) => getterOrArray[i] = val);
|
|
460
465
|
return new Proxy(target, ArrayItemHandler((target, i) => getterOrArray(i), setter ? (target, i, value) => setter(i, value) : undefined));
|
|
461
466
|
}
|
|
462
|
-
exports.CreateArrayProxy = CreateArrayProxy;
|
|
463
467
|
class __NumMap {
|
|
464
468
|
*keys() { for (let keyStr of Object.keys(this)) {
|
|
465
469
|
let key = Number(keyStr);
|
|
@@ -588,7 +592,6 @@ let sss;
|
|
|
588
592
|
function JSON_clone(obj) {
|
|
589
593
|
return JSON.parse(JSON.stringify(obj));
|
|
590
594
|
}
|
|
591
|
-
exports.JSON_clone = JSON_clone;
|
|
592
595
|
class CancelToken {
|
|
593
596
|
_cancel = false;
|
|
594
597
|
isCancelled() { return this._cancel; }
|
|
@@ -620,7 +623,6 @@ function createCancellableTimer(interval_ms, onTimer, onStop) {
|
|
|
620
623
|
};
|
|
621
624
|
return new CancelablePromise(executor, () => stop());
|
|
622
625
|
}
|
|
623
|
-
exports.createCancellableTimer = createCancellableTimer;
|
|
624
626
|
async function createCancellableTaskWrapper(task, isStopped, interval_ms = 50) {
|
|
625
627
|
let stopCheckingTask = createCancellableTimer(interval_ms, () => !isStopped?.());
|
|
626
628
|
try {
|
|
@@ -635,7 +637,6 @@ async function createCancellableTaskWrapper(task, isStopped, interval_ms = 50) {
|
|
|
635
637
|
stopCheckingTask.cancel();
|
|
636
638
|
}
|
|
637
639
|
}
|
|
638
|
-
exports.createCancellableTaskWrapper = createCancellableTaskWrapper;
|
|
639
640
|
class MyTimerInterval {
|
|
640
641
|
_timer;
|
|
641
642
|
_onstop;
|
|
@@ -689,7 +690,6 @@ async function copyToClipboard(textToCopy) {
|
|
|
689
690
|
});
|
|
690
691
|
}
|
|
691
692
|
}
|
|
692
|
-
exports.copyToClipboard = copyToClipboard;
|
|
693
693
|
class CObjectID {
|
|
694
694
|
static #id = 1;
|
|
695
695
|
value = CObjectID.#id++;
|
|
@@ -761,4 +761,3 @@ function isObjectCastableTo(object, members) {
|
|
|
761
761
|
return false;
|
|
762
762
|
return true;
|
|
763
763
|
}
|
|
764
|
-
exports.isObjectCastableTo = isObjectCastableTo;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CTestWeb =
|
|
3
|
+
exports.CTestWeb = void 0;
|
|
4
|
+
exports.funcPromiseServer = funcPromiseServer;
|
|
5
|
+
exports.funcPromiseServer2 = funcPromiseServer2;
|
|
6
|
+
exports.funcForWebSocket = funcForWebSocket;
|
|
7
|
+
exports.CreatAPIFacadeClient = CreatAPIFacadeClient;
|
|
8
|
+
exports.CreatAPIFacadeServer = CreatAPIFacadeServer;
|
|
9
|
+
exports.fMiniTest = fMiniTest;
|
|
4
10
|
const common_1 = require("./common");
|
|
5
11
|
function funcPromiseServer(data, obj) {
|
|
6
12
|
const buf = data;
|
|
@@ -70,7 +76,6 @@ function funcPromiseServer(data, obj) {
|
|
|
70
76
|
}
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
|
-
exports.funcPromiseServer = funcPromiseServer;
|
|
74
79
|
function funcPromiseServer2(sendMessage, obj) {
|
|
75
80
|
return async (datum) => {
|
|
76
81
|
const { key, request } = datum.data;
|
|
@@ -85,7 +90,6 @@ function funcPromiseServer2(sendMessage, obj) {
|
|
|
85
90
|
throw "это не функция";
|
|
86
91
|
};
|
|
87
92
|
}
|
|
88
|
-
exports.funcPromiseServer2 = funcPromiseServer2;
|
|
89
93
|
function funcForWebSocket(data) {
|
|
90
94
|
const limit = data.limit;
|
|
91
95
|
const sendMessage = data.sendMessage;
|
|
@@ -188,7 +192,6 @@ function funcForWebSocket(data) {
|
|
|
188
192
|
})
|
|
189
193
|
};
|
|
190
194
|
}
|
|
191
|
-
exports.funcForWebSocket = funcForWebSocket;
|
|
192
195
|
function funcScreenerClient2(data, wait) {
|
|
193
196
|
const tr = (address) => new Proxy((() => { }), {
|
|
194
197
|
get(target, p, receiver) {
|
|
@@ -328,7 +331,6 @@ function CreatAPIFacadeClient({ socketKey, socket, limit }) {
|
|
|
328
331
|
}
|
|
329
332
|
};
|
|
330
333
|
}
|
|
331
|
-
exports.CreatAPIFacadeClient = CreatAPIFacadeClient;
|
|
332
334
|
function CreatAPIFacadeServer({ object, socket, socketKey }) {
|
|
333
335
|
function ff(obj) {
|
|
334
336
|
return Object.fromEntries(Object.entries(obj).map(([k, v]) => {
|
|
@@ -351,10 +353,8 @@ function CreatAPIFacadeServer({ object, socket, socketKey }) {
|
|
|
351
353
|
}
|
|
352
354
|
}, object);
|
|
353
355
|
}
|
|
354
|
-
exports.CreatAPIFacadeServer = CreatAPIFacadeServer;
|
|
355
356
|
function fMiniTest() {
|
|
356
357
|
}
|
|
357
|
-
exports.fMiniTest = fMiniTest;
|
|
358
358
|
class CTestWeb {
|
|
359
359
|
func(a, b) {
|
|
360
360
|
return a + b;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FuncTimeWait =
|
|
3
|
+
exports.FuncTimeWait = void 0;
|
|
4
|
+
exports.funcTimeW = funcTimeW;
|
|
4
5
|
const map = {
|
|
5
6
|
binanceSpot: binanceSpotHistory2(),
|
|
6
7
|
binanceFutures: binanceSpotHistory3()
|
|
@@ -104,5 +105,4 @@ function funcTimeW() {
|
|
|
104
105
|
},
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
|
-
exports.funcTimeW = funcTimeW;
|
|
108
108
|
exports.FuncTimeWait = funcTimeW();
|