@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.
Files changed (42) hide show
  1. package/dist/UtilCodecs.d.ts +16 -16
  2. package/dist/UtilCodecs.js +16 -16
  3. package/dist/UtilCom.d.ts +22 -25
  4. package/dist/UtilCom.js +35 -38
  5. package/dist/UtilDecorators.d.ts +15 -8
  6. package/dist/UtilDecorators.js +79 -25
  7. package/dist/UtilFP.d.ts +46 -0
  8. package/dist/UtilFP.js +52 -0
  9. package/dist/UtilFfmpegTools.d.ts +30 -30
  10. package/dist/UtilFfmpegTools.js +32 -32
  11. package/dist/UtilFileTools.d.ts +30 -35
  12. package/dist/UtilFileTools.js +17 -18
  13. package/dist/UtilFunctions.d.ts +37 -78
  14. package/dist/UtilFunctions.js +27 -62
  15. package/dist/UtilInterfaces.d.ts +11 -11
  16. package/dist/UtilInterfaces.js +2 -2
  17. package/dist/UtilLogger.d.ts +55 -55
  18. package/dist/UtilLogger.js +55 -55
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +1 -0
  21. package/dist/test/composeTest.d.ts +21 -0
  22. package/dist/test/composeTest.js +33 -0
  23. package/dist/test/importtest.d.ts +1 -0
  24. package/dist/test/importtest.js +4 -0
  25. package/dist/test/test.js +5 -3
  26. package/package.json +1 -1
  27. package/src/UtilClass.ts +1051 -1051
  28. package/src/UtilCodecs.ts +117 -117
  29. package/src/UtilCom.ts +171 -174
  30. package/src/UtilDecorators.ts +174 -116
  31. package/src/UtilFP.ts +98 -0
  32. package/src/UtilFfmpegTools.ts +271 -271
  33. package/src/UtilFileTools.ts +231 -236
  34. package/src/UtilFunctions.ts +289 -364
  35. package/src/UtilInterfaces.ts +137 -137
  36. package/src/UtilLogger.ts +386 -386
  37. package/src/index.ts +10 -9
  38. package/src/test/composeTest.ts +37 -0
  39. package/src/test/importtest.ts +5 -0
  40. package/src/test/test.ts +8 -6
  41. package/src/test/test2.ts +2 -3
  42. package/tsconfig.json +2 -7
package/dist/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './UtilFfmpegTools';
7
7
  export * from './UtilDecorators';
8
8
  export * from './UtilFileTools';
9
9
  export * from './UtilLogger';
10
+ export * from './UtilFP';
package/dist/index.js CHANGED
@@ -23,3 +23,4 @@ __exportStar(require("./UtilFfmpegTools"), exports);
23
23
  __exportStar(require("./UtilDecorators"), exports);
24
24
  __exportStar(require("./UtilFileTools"), exports);
25
25
  __exportStar(require("./UtilLogger"), exports);
26
+ __exportStar(require("./UtilFP"), exports);
@@ -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 {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const composeTest_1 = require("./composeTest");
4
+ let a = composeTest_1.C.create();
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.composePartClass(tb, new A(), ...compKeys);
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.mapObject(ed, (k, v) => v ? v / BASE_MAX[k] : 0);
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 = UtilFunctions_1.UtilFunc.pipeline(Pointify, Sump);
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {