@zwa73/utils 1.0.114 → 1.0.115
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/QuickFunction.d.ts +1 -1
- package/dist/QuickFunction.js +2 -2
- package/dist/UtilFP.d.ts +22 -0
- package/dist/UtilFP.macro.d.ts +1 -0
- package/dist/UtilFP.macro.js +25 -0
- package/dist/UtilFileTools.js +0 -1
- package/dist/UtilFunctions.js +1 -1
- package/dist/UtilLogger.js +6 -1
- package/package.json +5 -4
- package/scripts/compile.ps1 +2 -1
- package/scripts/expand-macro.ps1 +2 -0
- package/scripts/release.ps1 +1 -2
- package/src/QuickFunction.ts +0 -1
- package/src/UtilFP.macro.ts +29 -0
- package/src/UtilFP.ts +40 -18
- package/src/UtilFileTools.ts +0 -1
- package/src/UtilFunctions.ts +1 -1
- package/src/UtilLogger.ts +6 -1
package/dist/QuickFunction.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UtilFunc } from "./UtilFunctions";
|
|
2
|
-
export declare const outcome: typeof UtilFunc.outcome, matchProc: typeof UtilFunc.matchProc, sucesProc: typeof UtilFunc.sucesProc, isFailed: typeof UtilFunc.isFailed, isSafeNumber: typeof UtilFunc.isSafeNumber, isSuccess: typeof UtilFunc.isSuccess, likeNone: typeof UtilFunc.likeNone, expect: typeof UtilFunc.expect, assertType: typeof UtilFunc.assertType, assertLiteral: typeof UtilFunc.assertLiteral, deepClone: typeof UtilFunc.deepClone, sleep: typeof UtilFunc.sleep, stringifyJToken: typeof UtilFunc.stringifyJToken, getTime: typeof UtilFunc.getTime, mapEntries: typeof UtilFunc.mapEntries, dedent: typeof UtilFunc.dedent, throwError: typeof UtilFunc.throwError
|
|
2
|
+
export declare const outcome: typeof UtilFunc.outcome, matchProc: typeof UtilFunc.matchProc, sucesProc: typeof UtilFunc.sucesProc, isFailed: typeof UtilFunc.isFailed, isSafeNumber: typeof UtilFunc.isSafeNumber, isSuccess: typeof UtilFunc.isSuccess, likeNone: typeof UtilFunc.likeNone, expect: typeof UtilFunc.expect, assertType: typeof UtilFunc.assertType, assertLiteral: typeof UtilFunc.assertLiteral, deepClone: typeof UtilFunc.deepClone, sleep: typeof UtilFunc.sleep, stringifyJToken: typeof UtilFunc.stringifyJToken, getTime: typeof UtilFunc.getTime, mapEntries: typeof UtilFunc.mapEntries, dedent: typeof UtilFunc.dedent, throwError: typeof UtilFunc.throwError;
|
package/dist/QuickFunction.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.throwError = exports.dedent = exports.mapEntries = exports.getTime = exports.stringifyJToken = exports.sleep = exports.deepClone = exports.assertLiteral = exports.assertType = exports.expect = exports.likeNone = exports.isSuccess = exports.isSafeNumber = exports.isFailed = exports.sucesProc = exports.matchProc = exports.outcome = void 0;
|
|
4
4
|
const UtilFunctions_1 = require("./UtilFunctions");
|
|
5
5
|
const UtilSymbol_1 = require("./UtilSymbol");
|
|
6
|
-
exports.outcome = UtilFunctions_1.UtilFunc.outcome, exports.matchProc = UtilFunctions_1.UtilFunc.matchProc, exports.sucesProc = UtilFunctions_1.UtilFunc.sucesProc, exports.isFailed = UtilFunctions_1.UtilFunc.isFailed, exports.isSafeNumber = UtilFunctions_1.UtilFunc.isSafeNumber, exports.isSuccess = UtilFunctions_1.UtilFunc.isSuccess, exports.likeNone = UtilFunctions_1.UtilFunc.likeNone, exports.expect = UtilFunctions_1.UtilFunc.expect, exports.assertType = UtilFunctions_1.UtilFunc.assertType, exports.assertLiteral = UtilFunctions_1.UtilFunc.assertLiteral, exports.deepClone = UtilFunctions_1.UtilFunc.deepClone, exports.sleep = UtilFunctions_1.UtilFunc.sleep, exports.stringifyJToken = UtilFunctions_1.UtilFunc.stringifyJToken, exports.getTime = UtilFunctions_1.UtilFunc.getTime, exports.mapEntries = UtilFunctions_1.UtilFunc.mapEntries, exports.dedent = UtilFunctions_1.UtilFunc.dedent, exports.throwError = UtilFunctions_1.UtilFunc.throwError
|
|
6
|
+
exports.outcome = UtilFunctions_1.UtilFunc.outcome, exports.matchProc = UtilFunctions_1.UtilFunc.matchProc, exports.sucesProc = UtilFunctions_1.UtilFunc.sucesProc, exports.isFailed = UtilFunctions_1.UtilFunc.isFailed, exports.isSafeNumber = UtilFunctions_1.UtilFunc.isSafeNumber, exports.isSuccess = UtilFunctions_1.UtilFunc.isSuccess, exports.likeNone = UtilFunctions_1.UtilFunc.likeNone, exports.expect = UtilFunctions_1.UtilFunc.expect, exports.assertType = UtilFunctions_1.UtilFunc.assertType, exports.assertLiteral = UtilFunctions_1.UtilFunc.assertLiteral, exports.deepClone = UtilFunctions_1.UtilFunc.deepClone, exports.sleep = UtilFunctions_1.UtilFunc.sleep, exports.stringifyJToken = UtilFunctions_1.UtilFunc.stringifyJToken, exports.getTime = UtilFunctions_1.UtilFunc.getTime, exports.mapEntries = UtilFunctions_1.UtilFunc.mapEntries, exports.dedent = UtilFunctions_1.UtilFunc.dedent, exports.throwError = UtilFunctions_1.UtilFunc.throwError;
|
|
7
7
|
if (false) {
|
|
8
8
|
let aaser = (0, exports.assertLiteral)({ a: 1 });
|
|
9
9
|
let a = null;
|
package/dist/UtilFP.d.ts
CHANGED
|
@@ -25,6 +25,17 @@ export declare namespace UtilFP {
|
|
|
25
25
|
export function flow<I, R1, R2, R3, R4, R5, R6, R7>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, ...fs: CompFunc<R7, R7>[]): CompFunc<I, R7>;
|
|
26
26
|
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, ...fs: CompFunc<R8, R8>[]): CompFunc<I, R8>;
|
|
27
27
|
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, ...fs: CompFunc<R9, R9>[]): CompFunc<I, R9>;
|
|
28
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, ...fs: CompFunc<R10, R10>[]): CompFunc<I, R10>;
|
|
29
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, ...fs: CompFunc<R11, R11>[]): CompFunc<I, R11>;
|
|
30
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, ...fs: CompFunc<R12, R12>[]): CompFunc<I, R12>;
|
|
31
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, ...fs: CompFunc<R13, R13>[]): CompFunc<I, R13>;
|
|
32
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, ...fs: CompFunc<R14, R14>[]): CompFunc<I, R14>;
|
|
33
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, ...fs: CompFunc<R15, R15>[]): CompFunc<I, R15>;
|
|
34
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, ...fs: CompFunc<R16, R16>[]): CompFunc<I, R16>;
|
|
35
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, ...fs: CompFunc<R17, R17>[]): CompFunc<I, R17>;
|
|
36
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, ...fs: CompFunc<R18, R18>[]): CompFunc<I, R18>;
|
|
37
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, ...fs: CompFunc<R19, R19>[]): CompFunc<I, R19>;
|
|
38
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, f20: CompFunc<R19, R20>, ...fs: CompFunc<R20, R20>[]): CompFunc<I, R20>;
|
|
28
39
|
/**函数管道
|
|
29
40
|
* 从左到右执行
|
|
30
41
|
* @param input - 初始输入值
|
|
@@ -41,6 +52,17 @@ export declare namespace UtilFP {
|
|
|
41
52
|
export function pipe<I, R1, R2, R3, R4, R5, R6, R7>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, ...fs: CompFunc<R7, R7>[]): R7;
|
|
42
53
|
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, ...fs: CompFunc<R8, R8>[]): R8;
|
|
43
54
|
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, ...fs: CompFunc<R9, R9>[]): R9;
|
|
55
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, ...fs: CompFunc<R10, R10>[]): R10;
|
|
56
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, ...fs: CompFunc<R11, R11>[]): R11;
|
|
57
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, ...fs: CompFunc<R12, R12>[]): R12;
|
|
58
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, ...fs: CompFunc<R13, R13>[]): R13;
|
|
59
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, ...fs: CompFunc<R14, R14>[]): R14;
|
|
60
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, ...fs: CompFunc<R15, R15>[]): R15;
|
|
61
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, ...fs: CompFunc<R16, R16>[]): R16;
|
|
62
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, ...fs: CompFunc<R17, R17>[]): R17;
|
|
63
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, ...fs: CompFunc<R18, R18>[]): R18;
|
|
64
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, ...fs: CompFunc<R19, R19>[]): R19;
|
|
65
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, f20: CompFunc<R19, R20>, ...fs: CompFunc<R20, R20>[]): R20;
|
|
44
66
|
/**将一个字段加入一个对象中, 返回新类型 */
|
|
45
67
|
/**绑定一个键和一个值到一个基础对象上, 并返回一个新的对象
|
|
46
68
|
* 新的对象包含了基础对象的所有属性, 以及一个新的属性,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dev_utils_1 = require("@zwa73/dev-utils");
|
|
4
|
+
const N = 20;
|
|
5
|
+
const R = (n) => n === 0 ? `I` : `R${n}`;
|
|
6
|
+
const prefix = (str, prefix) => str.length > 0 ? `${prefix}${str}` : str;
|
|
7
|
+
const suffix = (str, suffix) => str.length > 0 ? `${str}${suffix}` : str;
|
|
8
|
+
(0, dev_utils_1.$macro)("flow重载", (() => {
|
|
9
|
+
let result = ``;
|
|
10
|
+
for (let i = 0; i <= N; i++) {
|
|
11
|
+
const template = Array.from({ length: i + 1 }, (_, k) => R(k)).join(', ');
|
|
12
|
+
const args = suffix(Array.from({ length: i }, (_, k) => `f${k + 1}: CompFunc<${R(k)}, ${R(k + 1)}>`).join(', '), ", ");
|
|
13
|
+
result += `export function flow<${template}>(${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): CompFunc<I, ${R(i)}>;\n`;
|
|
14
|
+
}
|
|
15
|
+
return result.trim();
|
|
16
|
+
})());
|
|
17
|
+
(0, dev_utils_1.$macro)("pipe重载", (() => {
|
|
18
|
+
let result = ``;
|
|
19
|
+
for (let i = 0; i <= N; i++) {
|
|
20
|
+
const template = Array.from({ length: i + 1 }, (_, k) => R(k)).join(', ');
|
|
21
|
+
const args = suffix(Array.from({ length: i }, (_, k) => `f${k + 1}: CompFunc<${R(k)}, ${R(k + 1)}>`).join(', '), ", ");
|
|
22
|
+
result += `export function pipe<${template}>(input: I, ${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): ${R(i)};\n`;
|
|
23
|
+
}
|
|
24
|
+
return result.trim();
|
|
25
|
+
})());
|
package/dist/UtilFileTools.js
CHANGED
package/dist/UtilFunctions.js
CHANGED
|
@@ -577,7 +577,7 @@ class UtilFunc {
|
|
|
577
577
|
*/
|
|
578
578
|
static getFuncLoc(stack = 1) {
|
|
579
579
|
const stackLines = new Error().stack.split('\n');
|
|
580
|
-
const regex = /([a-zA-Z]+?:.+?):(\d+?:\d
|
|
580
|
+
const regex = /([a-zA-Z]+?:.+?):(\d+?:\d+)/;
|
|
581
581
|
//console.log(stackLines)
|
|
582
582
|
const match = regex.exec(stackLines[stack + 1]);
|
|
583
583
|
if (match) {
|
package/dist/UtilLogger.js
CHANGED
|
@@ -100,7 +100,12 @@ class SLogger {
|
|
|
100
100
|
messageList[0] = colorizer.colorize(info.level, messageList[0]);
|
|
101
101
|
for (let i = 1; i < messageList.length; i++)
|
|
102
102
|
messageList[i] = colorizer.colorize(info.level, messageList[i]);
|
|
103
|
-
|
|
103
|
+
let formattedMessage = messageList.join("\n");
|
|
104
|
+
const prefix = `[${info.timestamp}] [${colorizedLevel}]: `;
|
|
105
|
+
if (formattedMessage.startsWith(prefix))
|
|
106
|
+
formattedMessage = formattedMessage.slice(prefix.length);
|
|
107
|
+
return `${prefix}${formattedMessage}`;
|
|
108
|
+
//return `[${info.timestamp}] [${colorizedLevel}]: ${messageList.join("\n")}`;
|
|
104
109
|
}));
|
|
105
110
|
transports.push(new winston.transports.Console({
|
|
106
111
|
level: consoleLevel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwa73/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.115",
|
|
4
4
|
"description": "my utils",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"postinstall": "start node ./scripts/postinstall.js",
|
|
9
9
|
"release": "powershell scripts/release",
|
|
10
10
|
"compile": "powershell scripts/compile",
|
|
11
|
-
"watch": "powershell scripts/watch"
|
|
11
|
+
"watch": "powershell scripts/watch",
|
|
12
|
+
"expand-macro": "powershell scripts/expand-macro"
|
|
12
13
|
},
|
|
13
14
|
"keywords": [
|
|
14
15
|
"zwa73"
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
"author": "zwa73",
|
|
17
18
|
"license": "ISC",
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@types/fluent-ffmpeg": "^2.1.21",
|
|
20
20
|
"esm": "^3.2.25",
|
|
21
21
|
"esm-resolve": "^1.0.8",
|
|
22
22
|
"fluent-ffmpeg": "^2.1.2",
|
|
@@ -30,9 +30,10 @@
|
|
|
30
30
|
"winston-daily-rotate-file": "^4.7.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@types/fluent-ffmpeg": "^2.1.21",
|
|
33
34
|
"@types/jest": "^29.5.12",
|
|
34
35
|
"@types/node": "^18.16.3",
|
|
35
|
-
"@zwa73/dev-utils": "^1.0.
|
|
36
|
+
"@zwa73/dev-utils": "^1.0.33",
|
|
36
37
|
"jest": "^29.7.0",
|
|
37
38
|
"ts-jest": "^29.1.2",
|
|
38
39
|
"tsc-alias": "^1.8.8",
|
package/scripts/compile.ps1
CHANGED
package/scripts/release.ps1
CHANGED
package/src/QuickFunction.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {$macro} from '@zwa73/dev-utils';
|
|
2
|
+
|
|
3
|
+
const N = 20;
|
|
4
|
+
const R = (n:number)=>n===0?`I`:`R${n}`;
|
|
5
|
+
const prefix = (str:string,prefix?:string)=> str.length>0?`${prefix}${str}`:str;
|
|
6
|
+
const suffix = (str:string,suffix?:string)=> str.length>0?`${str}${suffix}`:str;
|
|
7
|
+
|
|
8
|
+
$macro("flow重载",(()=>{
|
|
9
|
+
let result = ``;
|
|
10
|
+
for (let i = 0; i <= N; i++) {
|
|
11
|
+
const template = Array.from({length: i+1}, (_, k) => R(k)).join(', ');
|
|
12
|
+
const args = suffix(Array.from({length: i}, (_, k) =>
|
|
13
|
+
`f${k+1}: CompFunc<${R(k)}, ${R(k+1)}>`
|
|
14
|
+
).join(', '),", ");
|
|
15
|
+
result += `export function flow<${template}>(${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): CompFunc<I, ${R(i)}>;\n`;
|
|
16
|
+
}
|
|
17
|
+
return result.trim();
|
|
18
|
+
})());
|
|
19
|
+
$macro("pipe重载",(()=>{
|
|
20
|
+
let result = ``;
|
|
21
|
+
for (let i = 0; i <= N; i++) {
|
|
22
|
+
const template = Array.from({length: i+1}, (_, k) => R(k)).join(', ');
|
|
23
|
+
const args = suffix(Array.from({length: i}, (_, k) =>
|
|
24
|
+
`f${k+1}: CompFunc<${R(k)}, ${R(k+1)}>`
|
|
25
|
+
).join(', '),", ");
|
|
26
|
+
result += `export function pipe<${template}>(input: I, ${args}...fs: CompFunc<${R(i)}, ${R(i)}>[]): ${R(i)};\n`;
|
|
27
|
+
}
|
|
28
|
+
return result.trim();
|
|
29
|
+
})());
|
package/src/UtilFP.ts
CHANGED
|
@@ -40,15 +40,26 @@ type CompFunc<T, R> = (arg: T) => R;
|
|
|
40
40
|
*/
|
|
41
41
|
//#region flow重载
|
|
42
42
|
export function flow<I>(...fs: CompFunc<I, I>[]): CompFunc<I, I>;
|
|
43
|
-
export function flow<I, R1>(f1: CompFunc<I, R1
|
|
44
|
-
export function flow<I, R1, R2>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2
|
|
45
|
-
export function flow<I, R1, R2, R3>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3
|
|
46
|
-
export function flow<I, R1, R2, R3, R4>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4
|
|
47
|
-
export function flow<I, R1, R2, R3, R4, R5>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5
|
|
48
|
-
export function flow<I, R1, R2, R3, R4, R5, R6>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6
|
|
49
|
-
export function flow<I, R1, R2, R3, R4, R5, R6, R7>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7
|
|
50
|
-
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8
|
|
51
|
-
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9
|
|
43
|
+
export function flow<I, R1>(f1: CompFunc<I, R1>, ...fs: CompFunc<R1, R1>[]): CompFunc<I, R1>;
|
|
44
|
+
export function flow<I, R1, R2>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, ...fs: CompFunc<R2, R2>[]): CompFunc<I, R2>;
|
|
45
|
+
export function flow<I, R1, R2, R3>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, ...fs: CompFunc<R3, R3>[]): CompFunc<I, R3>;
|
|
46
|
+
export function flow<I, R1, R2, R3, R4>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, ...fs: CompFunc<R4, R4>[]): CompFunc<I, R4>;
|
|
47
|
+
export function flow<I, R1, R2, R3, R4, R5>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, ...fs: CompFunc<R5, R5>[]): CompFunc<I, R5>;
|
|
48
|
+
export function flow<I, R1, R2, R3, R4, R5, R6>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, ...fs: CompFunc<R6, R6>[]): CompFunc<I, R6>;
|
|
49
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, ...fs: CompFunc<R7, R7>[]): CompFunc<I, R7>;
|
|
50
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, ...fs: CompFunc<R8, R8>[]): CompFunc<I, R8>;
|
|
51
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, ...fs: CompFunc<R9, R9>[]): CompFunc<I, R9>;
|
|
52
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, ...fs: CompFunc<R10, R10>[]): CompFunc<I, R10>;
|
|
53
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, ...fs: CompFunc<R11, R11>[]): CompFunc<I, R11>;
|
|
54
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, ...fs: CompFunc<R12, R12>[]): CompFunc<I, R12>;
|
|
55
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, ...fs: CompFunc<R13, R13>[]): CompFunc<I, R13>;
|
|
56
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, ...fs: CompFunc<R14, R14>[]): CompFunc<I, R14>;
|
|
57
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, ...fs: CompFunc<R15, R15>[]): CompFunc<I, R15>;
|
|
58
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, ...fs: CompFunc<R16, R16>[]): CompFunc<I, R16>;
|
|
59
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, ...fs: CompFunc<R17, R17>[]): CompFunc<I, R17>;
|
|
60
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, ...fs: CompFunc<R18, R18>[]): CompFunc<I, R18>;
|
|
61
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, ...fs: CompFunc<R19, R19>[]): CompFunc<I, R19>;
|
|
62
|
+
export function flow<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20>(f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, f20: CompFunc<R19, R20>, ...fs: CompFunc<R20, R20>[]): CompFunc<I, R20>;
|
|
52
63
|
//#endregion
|
|
53
64
|
export function flow<T>(...fs: ((arg: T) => T)[]): (arg: T) => T {
|
|
54
65
|
return (arg: T): T => {
|
|
@@ -64,15 +75,26 @@ export function flow<T>(...fs: ((arg: T) => T)[]): (arg: T) => T {
|
|
|
64
75
|
*/
|
|
65
76
|
//#region pipe重载
|
|
66
77
|
export function pipe<I>(input: I, ...fs: CompFunc<I, I>[]): I;
|
|
67
|
-
export function pipe<I, R1>(input: I, f1: CompFunc<I, R1
|
|
68
|
-
export function pipe<I, R1, R2>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2
|
|
69
|
-
export function pipe<I, R1, R2, R3>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3
|
|
70
|
-
export function pipe<I, R1, R2, R3, R4>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4
|
|
71
|
-
export function pipe<I, R1, R2, R3, R4, R5>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5
|
|
72
|
-
export function pipe<I, R1, R2, R3, R4, R5, R6>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6
|
|
73
|
-
export function pipe<I, R1, R2, R3, R4, R5, R6, R7>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7
|
|
74
|
-
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8
|
|
75
|
-
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9
|
|
78
|
+
export function pipe<I, R1>(input: I, f1: CompFunc<I, R1>, ...fs: CompFunc<R1, R1>[]): R1;
|
|
79
|
+
export function pipe<I, R1, R2>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, ...fs: CompFunc<R2, R2>[]): R2;
|
|
80
|
+
export function pipe<I, R1, R2, R3>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, ...fs: CompFunc<R3, R3>[]): R3;
|
|
81
|
+
export function pipe<I, R1, R2, R3, R4>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, ...fs: CompFunc<R4, R4>[]): R4;
|
|
82
|
+
export function pipe<I, R1, R2, R3, R4, R5>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, ...fs: CompFunc<R5, R5>[]): R5;
|
|
83
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, ...fs: CompFunc<R6, R6>[]): R6;
|
|
84
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, ...fs: CompFunc<R7, R7>[]): R7;
|
|
85
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, ...fs: CompFunc<R8, R8>[]): R8;
|
|
86
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, ...fs: CompFunc<R9, R9>[]): R9;
|
|
87
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, ...fs: CompFunc<R10, R10>[]): R10;
|
|
88
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, ...fs: CompFunc<R11, R11>[]): R11;
|
|
89
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, ...fs: CompFunc<R12, R12>[]): R12;
|
|
90
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, ...fs: CompFunc<R13, R13>[]): R13;
|
|
91
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, ...fs: CompFunc<R14, R14>[]): R14;
|
|
92
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, ...fs: CompFunc<R15, R15>[]): R15;
|
|
93
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, ...fs: CompFunc<R16, R16>[]): R16;
|
|
94
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, ...fs: CompFunc<R17, R17>[]): R17;
|
|
95
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, ...fs: CompFunc<R18, R18>[]): R18;
|
|
96
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, ...fs: CompFunc<R19, R19>[]): R19;
|
|
97
|
+
export function pipe<I, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20>(input: I, f1: CompFunc<I, R1>, f2: CompFunc<R1, R2>, f3: CompFunc<R2, R3>, f4: CompFunc<R3, R4>, f5: CompFunc<R4, R5>, f6: CompFunc<R5, R6>, f7: CompFunc<R6, R7>, f8: CompFunc<R7, R8>, f9: CompFunc<R8, R9>, f10: CompFunc<R9, R10>, f11: CompFunc<R10, R11>, f12: CompFunc<R11, R12>, f13: CompFunc<R12, R13>, f14: CompFunc<R13, R14>, f15: CompFunc<R14, R15>, f16: CompFunc<R15, R16>, f17: CompFunc<R16, R17>, f18: CompFunc<R17, R18>, f19: CompFunc<R18, R19>, f20: CompFunc<R19, R20>, ...fs: CompFunc<R20, R20>[]): R20;
|
|
76
98
|
//#endregion
|
|
77
99
|
export function pipe<T>(input: T, ...fs: ((arg: T) => T)[]): T {
|
|
78
100
|
return fs.reduce((value, func) => func(value), input);
|
package/src/UtilFileTools.ts
CHANGED
package/src/UtilFunctions.ts
CHANGED
|
@@ -654,7 +654,7 @@ static throwError(message:string,lvl?:LogLevel,opt?:{}):never{
|
|
|
654
654
|
*/
|
|
655
655
|
static getFuncLoc(stack=1) {
|
|
656
656
|
const stackLines = new Error().stack!.split('\n');
|
|
657
|
-
const regex = /([a-zA-Z]+?:.+?):(\d+?:\d
|
|
657
|
+
const regex = /([a-zA-Z]+?:.+?):(\d+?:\d+)/;
|
|
658
658
|
//console.log(stackLines)
|
|
659
659
|
const match = regex.exec(stackLines[stack+1]);
|
|
660
660
|
if(match){
|
package/src/UtilLogger.ts
CHANGED
|
@@ -91,7 +91,12 @@ export class SLogger{
|
|
|
91
91
|
messageList[0]=colorizer.colorize(info.level, messageList[0])
|
|
92
92
|
for(let i=1;i<messageList.length;i++)
|
|
93
93
|
messageList[i]=colorizer.colorize(info.level, messageList[i]);
|
|
94
|
-
|
|
94
|
+
let formattedMessage = messageList.join("\n");
|
|
95
|
+
const prefix = `[${info.timestamp}] [${colorizedLevel}]: `;
|
|
96
|
+
if (formattedMessage.startsWith(prefix))
|
|
97
|
+
formattedMessage = formattedMessage.slice(prefix.length);
|
|
98
|
+
return `${prefix}${formattedMessage}`;
|
|
99
|
+
//return `[${info.timestamp}] [${colorizedLevel}]: ${messageList.join("\n")}`;
|
|
95
100
|
}),
|
|
96
101
|
);
|
|
97
102
|
transports.push(new winston.transports.Console({
|