@zwa73/utils 1.0.60 → 1.0.61
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/UtilCodecs.d.ts +16 -16
- package/dist/UtilCodecs.js +16 -16
- package/dist/UtilCom.d.ts +22 -25
- package/dist/UtilCom.js +35 -38
- package/dist/UtilDecorators.d.ts +15 -8
- package/dist/UtilDecorators.js +79 -25
- package/dist/UtilFP.d.ts +46 -0
- package/dist/UtilFP.js +52 -0
- package/dist/UtilFfmpegTools.d.ts +30 -30
- package/dist/UtilFfmpegTools.js +32 -32
- package/dist/UtilFileTools.d.ts +30 -35
- package/dist/UtilFileTools.js +17 -18
- package/dist/UtilFunctions.d.ts +37 -78
- package/dist/UtilFunctions.js +27 -62
- package/dist/UtilInterfaces.d.ts +11 -11
- package/dist/UtilInterfaces.js +2 -2
- package/dist/UtilLogger.d.ts +55 -55
- package/dist/UtilLogger.js +55 -55
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/test/composeTest.d.ts +21 -0
- package/dist/test/composeTest.js +33 -0
- package/dist/test/importtest.d.ts +1 -0
- package/dist/test/importtest.js +4 -0
- package/dist/test/test.js +5 -3
- package/package.json +1 -1
- package/src/UtilClass.ts +1051 -1051
- package/src/UtilCodecs.ts +117 -117
- package/src/UtilCom.ts +171 -174
- package/src/UtilDecorators.ts +174 -116
- package/src/UtilFP.ts +98 -0
- package/src/UtilFfmpegTools.ts +271 -271
- package/src/UtilFileTools.ts +231 -236
- package/src/UtilFunctions.ts +289 -364
- package/src/UtilInterfaces.ts +137 -137
- package/src/UtilLogger.ts +386 -386
- package/src/index.ts +10 -9
- package/src/test/composeTest.ts +37 -0
- package/src/test/importtest.ts +5 -0
- package/src/test/test.ts +8 -6
- package/src/test/test2.ts +2 -3
- package/tsconfig.json +2 -7
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare class A {
|
|
2
|
+
private num;
|
|
3
|
+
getNum: () => number;
|
|
4
|
+
/**A的函数 */
|
|
5
|
+
getA: () => this;
|
|
6
|
+
}
|
|
7
|
+
declare class B {
|
|
8
|
+
private text;
|
|
9
|
+
getText: () => string;
|
|
10
|
+
/**B的函数 */
|
|
11
|
+
getB: () => this;
|
|
12
|
+
/**B的静态函数 */
|
|
13
|
+
static getNewB: () => B;
|
|
14
|
+
/**保留的函数 */
|
|
15
|
+
privateFunc(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare const C: import("..").ComposedClassPart<{
|
|
18
|
+
create(): A & Pick<B, "getB" | "getText"> & Record<"bindFunc", () => "这是动态绑定的函数">;
|
|
19
|
+
}, typeof B, "getNewB">;
|
|
20
|
+
export type C = ReturnType<typeof C.create>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.C = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
class A {
|
|
6
|
+
num = 1;
|
|
7
|
+
getNum = () => this.num;
|
|
8
|
+
/**A的函数 */
|
|
9
|
+
getA = () => this;
|
|
10
|
+
}
|
|
11
|
+
class B {
|
|
12
|
+
text = "B的text";
|
|
13
|
+
getText = () => this.text;
|
|
14
|
+
/**B的函数 */
|
|
15
|
+
getB = () => this;
|
|
16
|
+
/**B的静态函数 */
|
|
17
|
+
static getNewB = () => new B();
|
|
18
|
+
/**保留的函数 */
|
|
19
|
+
privateFunc() { }
|
|
20
|
+
}
|
|
21
|
+
exports.C = __1.UtilFunc.composeClassPart({
|
|
22
|
+
create() {
|
|
23
|
+
let o1 = __1.UtilFunc.composeClassPart(new A(), new B(), 'getB', 'getText');
|
|
24
|
+
let o2 = __1.UtilFP.bindTo('bindFunc', () => "这是动态绑定的函数", o1);
|
|
25
|
+
return o2;
|
|
26
|
+
}
|
|
27
|
+
}, B, 'getNewB');
|
|
28
|
+
const insc = exports.C.create(); //?
|
|
29
|
+
exports.C.getNewB().getB().getText(); //?
|
|
30
|
+
insc.getText(); //?
|
|
31
|
+
insc.getB().getText(); //?
|
|
32
|
+
insc.getNum(); //?
|
|
33
|
+
insc.bindFunc(); //?
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/test/test.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const UtilFP_1 = require("../UtilFP");
|
|
3
4
|
const UtilFunctions_1 = require("../UtilFunctions");
|
|
4
5
|
const compKeys = ["getData", "getA"];
|
|
5
6
|
class A {
|
|
@@ -32,7 +33,7 @@ class B {
|
|
|
32
33
|
_bc;
|
|
33
34
|
constructor() {
|
|
34
35
|
const tb = this;
|
|
35
|
-
this._bc = UtilFunctions_1.UtilFunc.
|
|
36
|
+
this._bc = UtilFunctions_1.UtilFunc.composeClassPart(tb, new A(), ...compKeys);
|
|
36
37
|
}
|
|
37
38
|
static init() {
|
|
38
39
|
return new B()._bc;
|
|
@@ -103,9 +104,9 @@ const 精调后 = [
|
|
|
103
104
|
{ 攻击: 43, 生命: 0, 防御: 8.0, 暴击: 0, 暴击伤害: 0, 攻击加成: 7.3, 生命加成: 0, 防御加成: 0 },
|
|
104
105
|
{ 攻击: 42, 生命: 54, 防御: 0, 暴击: 0, 暴击伤害: 0, 攻击加成: 6.2, 生命加成: 0, 防御加成: 0 }, // 机枪 双重对策 折叠脚架
|
|
105
106
|
];
|
|
106
|
-
const Pointify = (ed) => UtilFunctions_1.UtilFunc.
|
|
107
|
+
const Pointify = (ed) => UtilFunctions_1.UtilFunc.mapEntries(ed, (k, v) => v ? v / BASE_MAX[k] : 0);
|
|
107
108
|
const Sump = (ed) => Object.values(ed).reduce((r, v) => r + v);
|
|
108
|
-
const pipeFunc =
|
|
109
|
+
const pipeFunc = UtilFP_1.UtilFP.flow(Pointify, Sump);
|
|
109
110
|
const Display = (list) => list.reduce((r, v) => `${r}\t${v.toFixed(2)}`, "").trim();
|
|
110
111
|
const pre = 精调前.map((v) => pipeFunc(v));
|
|
111
112
|
const aft = 精调后.map((v) => pipeFunc(v));
|
|
@@ -185,3 +186,4 @@ let testkeys = [];
|
|
|
185
186
|
for (let k in testa)
|
|
186
187
|
testkeys.push(k);
|
|
187
188
|
testkeys; //?
|
|
189
|
+
const a = "123";
|