@zwa73/utils 1.0.272 → 1.0.274
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/QuickExport.d.ts +1 -1
- package/dist/UtilClass/Hbs.d.ts +1 -1
- package/dist/UtilClass/Hbs.js +1 -1
- package/dist/UtilClass/Markdown.d.ts +2 -2
- package/dist/UtilClass/Markdown.js +9 -3
- package/dist/UtilFileTools.d.ts +2 -2
- package/dist/UtilFileTools.js +4 -4
- package/dist/UtilFunctions.d.ts +6 -6
- package/dist/UtilFunctions.js +16 -9
- package/dist/UtilHttp.d.ts +4 -3
- package/dist/UtilHttp.js +5 -5
- package/dist/UtilI18n.d.ts +1 -1
- package/dist/UtilI18n.js +1 -1
- package/dist/UtilLogger.d.ts +1 -1
- package/dist/UtilLogger.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +23 -3
package/dist/QuickExport.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UtilFT } from "./UtilFileTools";
|
|
2
2
|
export declare const outcome: typeof import("@zwa73/js-utils").JsFunc.outcome, extractOutcome: typeof import("@zwa73/js-utils").JsFunc.extractOutcome, success: typeof import("@zwa73/js-utils").JsFunc.success, failed: typeof import("@zwa73/js-utils").JsFunc.failed, match: typeof import("@zwa73/js-utils").JsFunc.match, isSafeNumber: typeof import("@zwa73/js-utils").JsFunc.isSafeNumber, assertType: typeof import("@zwa73/js-utils").JsFunc.assertType, assertLiteral: typeof import("@zwa73/js-utils").JsFunc.assertLiteral, deepClone: typeof import("@zwa73/js-utils").JsFunc.deepClone, sleep: typeof import("@zwa73/js-utils").JsFunc.sleep, stringifyJToken: typeof import("@zwa73/js-utils").JsFunc.stringifyJToken, getTime: typeof import("@zwa73/js-utils").JsFunc.getTime, mapEntries: typeof import("@zwa73/js-utils").JsFunc.mapEntries, dedent: typeof import("@zwa73/js-utils").JsFunc.dedent, throwError: typeof import("@zwa73/js-utils").JsFunc.throwError, eitherize: typeof import("@zwa73/js-utils").JsFunc.eitherize, memoize: typeof import("@zwa73/js-utils").JsFunc.memoize, lazyFunction: typeof import("@zwa73/js-utils").JsFunc.lazyFunction, ivk: typeof import("@zwa73/js-utils").JsFunc.ivk, l2s: typeof import("@zwa73/js-utils").JsFunc.l2s, s2l: typeof import("@zwa73/js-utils").JsFunc.s2l, structEqual: typeof import("@zwa73/js-utils").JsFunc.structEqual, range: typeof import("@zwa73/js-utils").JsFunc.range, preset: typeof import("@zwa73/js-utils").JsFunc.preset, assignOption: typeof import("@zwa73/js-utils").JsFunc.assignOption;
|
|
3
3
|
export declare const stylizePath: typeof UtilFT.stylizePath, posixizePath: typeof UtilFT.posixizePath, win32izePath: typeof UtilFT.win32izePath, currosizePath: typeof UtilFT.currosizePath;
|
|
4
|
-
export declare const when: <S extends import("@zwa73/js-utils").Keyable, T, R>(stat: import("@zwa73/js-utils").Literal<S>, f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<S>>) => R) => (arg: T) => (
|
|
4
|
+
export declare const when: <S extends import("@zwa73/js-utils").Keyable, T, R>(stat: import("@zwa73/js-utils").Literal<S>, f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<S>>) => R) => (arg: T) => (false extends (symbol extends T ? S extends T & symbol ? false : true : string extends T ? S extends T & string ? false : true : number extends T ? S extends T & number ? false : true : true) ? T | R : import("@zwa73/js-utils").MatchableFlag<T> extends S ? Exclude<T, import("@zwa73/js-utils").Matchable<S>> | R : import("@zwa73/js-utils").MatchableFlag<T> extends Exclude<S, import("@zwa73/js-utils").MatchableFlag<T>> ? T : Exclude<T, import("@zwa73/js-utils").Matchable<S>> | R), map: typeof import("@zwa73/js-utils").JsFP.map, flow: typeof import("@zwa73/js-utils").JsFP.flow, pipe: typeof import("@zwa73/js-utils").JsFP.pipe, chain: <T, R>(f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Success>>) => R) => (arg: T) => (false extends (symbol extends T ? typeof import("@zwa73/js-utils").Success extends infer T_1 ? T_1 extends typeof import("@zwa73/js-utils").Success ? T_1 extends T & symbol ? false : true : never : never : string extends T ? typeof import("@zwa73/js-utils").Success extends infer T_2 ? T_2 extends typeof import("@zwa73/js-utils").Success ? T_2 extends T & string ? false : true : never : never : number extends T ? typeof import("@zwa73/js-utils").Success extends infer T_3 ? T_3 extends typeof import("@zwa73/js-utils").Success ? T_3 extends T & number ? false : true : never : never : true) ? T | R : import("@zwa73/js-utils").MatchableFlag<T> extends typeof import("@zwa73/js-utils").Success ? Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Success>> | R : import("@zwa73/js-utils").MatchableFlag<T> extends Exclude<typeof import("@zwa73/js-utils").Success, import("@zwa73/js-utils").MatchableFlag<T>> ? T : Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Success>> | R), alt: <T, R>(f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Failed>>) => R) => (arg: T) => (false extends (symbol extends T ? typeof import("@zwa73/js-utils").Failed extends infer T_1 ? T_1 extends typeof import("@zwa73/js-utils").Failed ? T_1 extends T & symbol ? false : true : never : never : string extends T ? typeof import("@zwa73/js-utils").Failed extends infer T_2 ? T_2 extends typeof import("@zwa73/js-utils").Failed ? T_2 extends T & string ? false : true : never : never : number extends T ? typeof import("@zwa73/js-utils").Failed extends infer T_3 ? T_3 extends typeof import("@zwa73/js-utils").Failed ? T_3 extends T & number ? false : true : never : never : true) ? T | R : import("@zwa73/js-utils").MatchableFlag<T> extends typeof import("@zwa73/js-utils").Failed ? Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Failed>> | R : import("@zwa73/js-utils").MatchableFlag<T> extends Exclude<typeof import("@zwa73/js-utils").Failed, import("@zwa73/js-utils").MatchableFlag<T>> ? T : Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Failed>> | R), tap: typeof import("@zwa73/js-utils").JsFP.tap, curry: typeof import("@zwa73/js-utils").JsFP.curry;
|
package/dist/UtilClass/Hbs.d.ts
CHANGED
package/dist/UtilClass/Hbs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Hbs = void 0;
|
|
4
|
-
const UtilLogger_1 = require("../UtilLogger");
|
|
5
4
|
const js_utils_1 = require("@zwa73/js-utils");
|
|
6
5
|
const UtilFunctions_1 = require("../UtilFunctions");
|
|
6
|
+
const UtilLogger_1 = require("../UtilLogger");
|
|
7
7
|
/**文本模板渲染器
|
|
8
8
|
* @template T - 上下文对象的类型,默认为记录类型
|
|
9
9
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stringify } from 'yaml';
|
|
1
|
+
import type { stringify } from 'yaml';
|
|
2
2
|
type ExtractBlockOpt = {
|
|
3
3
|
/**要提取的标题 必须为 "# 标题" 的格式 */
|
|
4
4
|
title: string;
|
|
@@ -21,7 +21,7 @@ export declare class Markdown {
|
|
|
21
21
|
/**从数据构建 */
|
|
22
22
|
static from(arg?: FromArg): Markdown;
|
|
23
23
|
/**输出md文本 */
|
|
24
|
-
stringify(opt: Exclude<Parameters<typeof stringify>[2], string | number>): string
|
|
24
|
+
stringify(opt: Exclude<Parameters<typeof stringify>[2], string | number>): Promise<string>;
|
|
25
25
|
/**根据标题提取块
|
|
26
26
|
* @param opt - 选项
|
|
27
27
|
*/
|
|
@@ -6,14 +6,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Markdown = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const js_utils_1 = require("@zwa73/js-utils");
|
|
9
|
+
const UtilFunctions_1 = require("../UtilFunctions");
|
|
9
10
|
const UtilLogger_1 = require("../UtilLogger");
|
|
10
|
-
const yaml_1 = require("yaml");
|
|
11
11
|
const getMatter = async () => {
|
|
12
12
|
const matter = await js_utils_1.JsFunc.dynamicImport('gray-matter');
|
|
13
13
|
if (matter == undefined)
|
|
14
14
|
js_utils_1.JsFunc.throwError(`npm包 gray-matter 动态导入失败, 此包不会随@zwa73/utils自动安装, 可能是未安装, 可使用 npm i gray-matter@4.0.3 来安装`);
|
|
15
15
|
return matter;
|
|
16
16
|
};
|
|
17
|
+
const getYaml = async () => {
|
|
18
|
+
const yaml = await UtilFunctions_1.UtilFunc.dynamicImport('yaml');
|
|
19
|
+
if (yaml == undefined)
|
|
20
|
+
UtilFunctions_1.UtilFunc.throwError(`npm包 yaml 动态导入失败, 此包不会随@zwa73/utils自动安装, 可能是未安装, 可使用 npm i yaml@2.8.1 来安装`);
|
|
21
|
+
return yaml;
|
|
22
|
+
};
|
|
17
23
|
/**Markdown解析器 */
|
|
18
24
|
class Markdown {
|
|
19
25
|
data;
|
|
@@ -37,8 +43,8 @@ class Markdown {
|
|
|
37
43
|
return new Markdown(arg.data, arg.content);
|
|
38
44
|
}
|
|
39
45
|
/**输出md文本 */
|
|
40
|
-
stringify(opt) {
|
|
41
|
-
const yamlText = Object.values(this.data ?? {}).length > 0 ? `---\n${(
|
|
46
|
+
async stringify(opt) {
|
|
47
|
+
const yamlText = Object.values(this.data ?? {}).length > 0 ? `---\n${(await getYaml()).stringify(this.data, opt)}---\n` : '';
|
|
42
48
|
return `${yamlText}${this.content}`;
|
|
43
49
|
//return (await getMatter()).stringify(this.content,this.data);
|
|
44
50
|
}
|
package/dist/UtilFileTools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JToken } from "./UtilInterfaces";
|
|
2
|
-
import { HashAlgorithm } from "./UtilFunctions";
|
|
1
|
+
import type { JToken } from "./UtilInterfaces";
|
|
2
|
+
import type { HashAlgorithm } from "./UtilFunctions";
|
|
3
3
|
/**创建文件选项 */
|
|
4
4
|
type CreatePathOpt = Partial<{
|
|
5
5
|
/**创建一个目录 默认 false
|
package/dist/UtilFileTools.js
CHANGED
|
@@ -27,14 +27,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.UtilFT = void 0;
|
|
30
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
30
31
|
const fs = __importStar(require("fs"));
|
|
31
|
-
const pathe_1 = __importDefault(require("pathe"));
|
|
32
32
|
const os = __importStar(require("os"));
|
|
33
|
-
const UtilLogger_1 = require("./UtilLogger");
|
|
34
|
-
const JSON5 = __importStar(require("json5"));
|
|
35
33
|
const glob_1 = require("glob");
|
|
34
|
+
const JSON5 = __importStar(require("json5"));
|
|
35
|
+
const pathe_1 = __importDefault(require("pathe"));
|
|
36
|
+
const UtilLogger_1 = require("./UtilLogger");
|
|
36
37
|
const UtilFunctions_1 = require("./UtilFunctions");
|
|
37
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
38
38
|
/**文件工具 */
|
|
39
39
|
var UtilFT;
|
|
40
40
|
(function (UtilFT) {
|
package/dist/UtilFunctions.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { LogLevel } from "./UtilInterfaces";
|
|
2
1
|
import { JsFunc } from "@zwa73/js-utils";
|
|
2
|
+
import type { LogLevel } from "./UtilInterfaces";
|
|
3
3
|
export type { PromiseRetries, PromiseRetryResult } from "@zwa73/js-utils";
|
|
4
4
|
declare const HashAlgorithmList: readonly ["RSA-MD5", "RSA-RIPEMD160", "RSA-SHA1", "RSA-SHA1-2", "RSA-SHA224", "RSA-SHA256", "RSA-SHA3-224", "RSA-SHA3-256", "RSA-SHA3-384", "RSA-SHA3-512", "RSA-SHA384", "RSA-SHA512", "RSA-SHA512/224", "RSA-SHA512/256", "RSA-SM3", "blake2b512", "blake2s256", "id-rsassa-pkcs1-v1_5-with-sha3-224", "id-rsassa-pkcs1-v1_5-with-sha3-256", "id-rsassa-pkcs1-v1_5-with-sha3-384", "id-rsassa-pkcs1-v1_5-with-sha3-512", "md5", "md5-sha1", "md5WithRSAEncryption", "ripemd", "ripemd160", "ripemd160WithRSA", "rmd160", "sha1", "sha1WithRSAEncryption", "sha224", "sha224WithRSAEncryption", "sha256", "sha256WithRSAEncryption", "sha3-224", "sha3-256", "sha3-384", "sha3-512", "sha384", "sha384WithRSAEncryption", "sha512", "sha512-224", "sha512-224WithRSAEncryption", "sha512-256", "sha512-256WithRSAEncryption", "sha512WithRSAEncryption", "shake128", "shake256", "sm3", "sm3WithRSAEncryption", "ssl3-md5", "ssl3-sha1"];
|
|
5
5
|
export type HashAlgorithm = typeof HashAlgorithmList[number];
|
|
6
6
|
/**执行选项 */
|
|
7
7
|
type ExecOpt = Partial<{
|
|
8
|
-
outlvl: LogLevel;
|
|
9
|
-
errlvl: LogLevel;
|
|
8
|
+
outlvl: LogLevel | ((arg: string) => any);
|
|
9
|
+
errlvl: LogLevel | ((arg: string) => any);
|
|
10
10
|
/**node_modules文件夹目录, 用于设定环境变量 */
|
|
11
11
|
nodeModules: string;
|
|
12
12
|
/**工作路径 */
|
|
@@ -32,8 +32,8 @@ declare class _UtilFunc {
|
|
|
32
32
|
/**封装的 cp.spawn 执行一段指令,指令运行时实时返回输出
|
|
33
33
|
* @param command - 指令文本
|
|
34
34
|
* @param opt - 可选参数
|
|
35
|
-
* @param opt.outlvl - 普通输出的日志等级
|
|
36
|
-
* @param opt.errlvl - 错误的日志等级
|
|
35
|
+
* @param opt.outlvl - 普通输出的日志等级 传入函数时直接转接为函数
|
|
36
|
+
* @param opt.errlvl - 错误的日志等级 传入函数时直接转接为函数
|
|
37
37
|
* @param opt.nodeModules - nodeModules文件夹路径
|
|
38
38
|
* @param opt.cwd - 执行目录
|
|
39
39
|
* @param opt.env - 额外环境变量
|
|
@@ -47,5 +47,5 @@ declare class _UtilFunc {
|
|
|
47
47
|
*/
|
|
48
48
|
static getPublicIpv4(): Promise<string | undefined>;
|
|
49
49
|
}
|
|
50
|
-
export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "match" | "failed" | "success" | "prototype" | "
|
|
50
|
+
export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "match" | "failed" | "success" | "prototype" | "range" | "genUUID" | "preset" | "assignOption" | "getTime" | "initField" | "initObject" | "afterward" | "sleep" | "getNeverResolvedPromise" | "retryPromise" | "timelimitPromise" | "mapEntries" | "eachField" | "stringifyJToken" | "sortJToken" | "assertType" | "assertLiteral" | "deepClone" | "isSafeNumber" | "dedent" | "throwError" | "getStack" | "getFuncLoc" | "cachePool" | "memoize" | "asyncize" | "lazyFunction" | "splitToChunk" | "mergeFromChunk" | "structEqual" | "concurrent" | "dynamicImport" | "createInjectable" | "createAsyncProxy" | "checkSharpSchema" | "unwarpReadonly" | "outcome" | "extractOutcome" | "isStatus" | "eitherize" | "parseSrtTime" | "formatSrtTime" | "parseSrt" | "createSrt" | "ivk" | "s2l" | "l2s">;
|
|
51
51
|
export type UtilFunc = typeof UtilFunc;
|
package/dist/UtilFunctions.js
CHANGED
|
@@ -27,14 +27,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.UtilFunc = void 0;
|
|
30
|
-
const crypto = __importStar(require("crypto"));
|
|
31
30
|
const cp = __importStar(require("child_process"));
|
|
32
|
-
const
|
|
31
|
+
const crypto = __importStar(require("crypto"));
|
|
33
32
|
const path_1 = __importDefault(require("path"));
|
|
34
|
-
const UtilFileTools_1 = require("./UtilFileTools");
|
|
35
|
-
const UtilLogger_1 = require("./UtilLogger");
|
|
36
33
|
const js_utils_1 = require("@zwa73/js-utils");
|
|
37
34
|
const modular_mixer_1 = require("@zwa73/modular-mixer");
|
|
35
|
+
const UtilSymbol_1 = require("./UtilSymbol");
|
|
36
|
+
const UtilFileTools_1 = require("./UtilFileTools");
|
|
37
|
+
const UtilLogger_1 = require("./UtilLogger");
|
|
38
38
|
const HashAlgorithmList = [
|
|
39
39
|
'RSA-MD5', 'RSA-RIPEMD160', 'RSA-SHA1', 'RSA-SHA1-2', 'RSA-SHA224',
|
|
40
40
|
'RSA-SHA256', 'RSA-SHA3-224', 'RSA-SHA3-256', 'RSA-SHA3-384', 'RSA-SHA3-512',
|
|
@@ -68,8 +68,8 @@ class _UtilFunc {
|
|
|
68
68
|
/**封装的 cp.spawn 执行一段指令,指令运行时实时返回输出
|
|
69
69
|
* @param command - 指令文本
|
|
70
70
|
* @param opt - 可选参数
|
|
71
|
-
* @param opt.outlvl - 普通输出的日志等级
|
|
72
|
-
* @param opt.errlvl - 错误的日志等级
|
|
71
|
+
* @param opt.outlvl - 普通输出的日志等级 传入函数时直接转接为函数
|
|
72
|
+
* @param opt.errlvl - 错误的日志等级 传入函数时直接转接为函数
|
|
73
73
|
* @param opt.nodeModules - nodeModules文件夹路径
|
|
74
74
|
* @param opt.cwd - 执行目录
|
|
75
75
|
* @param opt.env - 额外环境变量
|
|
@@ -97,12 +97,19 @@ class _UtilFunc {
|
|
|
97
97
|
child.stdout.on('data', (data) => {
|
|
98
98
|
stdout += data;
|
|
99
99
|
if (opt?.outlvl)
|
|
100
|
-
|
|
100
|
+
if (typeof opt.outlvl === "function")
|
|
101
|
+
opt.outlvl(data.toString());
|
|
102
|
+
else
|
|
103
|
+
UtilLogger_1.SLogger.log(opt?.outlvl, data.toString());
|
|
101
104
|
});
|
|
102
105
|
child.stderr.on('data', (data) => {
|
|
103
106
|
stderr += data;
|
|
104
|
-
if (opt?.errlvl)
|
|
105
|
-
|
|
107
|
+
if (opt?.errlvl) {
|
|
108
|
+
if (typeof opt.errlvl === "function")
|
|
109
|
+
opt.errlvl(data.toString());
|
|
110
|
+
else
|
|
111
|
+
UtilLogger_1.SLogger.log(opt?.errlvl, data.toString());
|
|
112
|
+
}
|
|
106
113
|
});
|
|
107
114
|
child.on('error', reject);
|
|
108
115
|
child.on('close', (code) => {
|
package/dist/UtilHttp.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AnyString, JToken, MPromise, PartialOption, StatusVerifyFn } from "./UtilInterfaces";
|
|
2
1
|
import http from 'http';
|
|
3
|
-
import {
|
|
2
|
+
import type { LogLevel } from "@zwa73/js-utils";
|
|
3
|
+
import { PromiseQueue } from "@zwa73/js-utils";
|
|
4
4
|
import FormData from "form-data";
|
|
5
|
-
import {
|
|
5
|
+
import type { PromiseRetries } from "./UtilFunctions";
|
|
6
|
+
import type { AnyString, JToken, MPromise, PartialOption, StatusVerifyFn } from "./UtilInterfaces";
|
|
6
7
|
/**网络请求返回值 */
|
|
7
8
|
export type RequestResult<T> = {
|
|
8
9
|
/**响应头 */
|
package/dist/UtilHttp.js
CHANGED
|
@@ -4,18 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.UtilHttp = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
8
|
const http_1 = __importDefault(require("http"));
|
|
8
9
|
const https_1 = __importDefault(require("https"));
|
|
9
|
-
const url_1 = require("url");
|
|
10
|
-
const UtilLogger_1 = require("./UtilLogger");
|
|
11
|
-
const UtilFunctions_1 = require("./UtilFunctions");
|
|
12
10
|
const querystring_1 = __importDefault(require("querystring"));
|
|
11
|
+
const url_1 = require("url");
|
|
12
|
+
const js_utils_1 = require("@zwa73/js-utils");
|
|
13
13
|
const form_data_1 = __importDefault(require("form-data"));
|
|
14
14
|
const http_proxy_agent_1 = __importDefault(require("http-proxy-agent"));
|
|
15
15
|
const https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
|
|
16
|
-
const js_utils_1 = require("@zwa73/js-utils");
|
|
17
|
-
const fs_1 = __importDefault(require("fs"));
|
|
18
16
|
const pathe_1 = __importDefault(require("pathe"));
|
|
17
|
+
const UtilFunctions_1 = require("./UtilFunctions");
|
|
18
|
+
const UtilLogger_1 = require("./UtilLogger");
|
|
19
19
|
const RequestDefOption = {
|
|
20
20
|
logLevel: 'http',
|
|
21
21
|
timeout: 0,
|
package/dist/UtilI18n.d.ts
CHANGED
package/dist/UtilI18n.js
CHANGED
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SI18n = void 0;
|
|
7
|
+
const pathe_1 = __importDefault(require("pathe"));
|
|
7
8
|
const UtilFileTools_1 = require("./UtilFileTools");
|
|
8
9
|
const UtilFunctions_1 = require("./UtilFunctions");
|
|
9
10
|
const UtilLogger_1 = require("./UtilLogger");
|
|
10
|
-
const pathe_1 = __importDefault(require("pathe"));
|
|
11
11
|
/**语言:地区 表 */
|
|
12
12
|
const I18nFlagTable = {
|
|
13
13
|
"zh": ["CN", "TW"],
|
package/dist/UtilLogger.d.ts
CHANGED
package/dist/UtilLogger.js
CHANGED
|
@@ -27,10 +27,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.SLogger = void 0;
|
|
30
|
+
const util_1 = require("util");
|
|
30
31
|
const pathe_1 = __importDefault(require("pathe"));
|
|
31
32
|
const winston = __importStar(require("winston"));
|
|
32
33
|
const winston_daily_rotate_file_1 = __importDefault(require("winston-daily-rotate-file"));
|
|
33
|
-
const util_1 = require("util");
|
|
34
34
|
const logLevels = {
|
|
35
35
|
fatal: 0,
|
|
36
36
|
error: 1,
|
package/dist/index.js
CHANGED
|
@@ -26,9 +26,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const UtilLogger_1 = require("./UtilLogger");
|
|
30
|
-
const js_utils_1 = require("@zwa73/js-utils");
|
|
31
29
|
const crypto = __importStar(require("crypto"));
|
|
30
|
+
const js_utils_1 = require("@zwa73/js-utils");
|
|
31
|
+
const UtilLogger_1 = require("./UtilLogger");
|
|
32
32
|
js_utils_1.JsDepInjector.inject('logger', UtilLogger_1.SLogger);
|
|
33
33
|
js_utils_1.JsDepInjector.inject('genUUID', () => crypto.randomBytes(16).toString("hex"));
|
|
34
34
|
__exportStar(require("./UtilFunctions"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwa73/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.274",
|
|
4
4
|
"description": "my utils",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,9 +27,28 @@
|
|
|
27
27
|
"pathe": "^1.1.2",
|
|
28
28
|
"querystring": "^0.2.1",
|
|
29
29
|
"winston": "^3.10.0",
|
|
30
|
-
"winston-daily-rotate-file": "^4.7.1"
|
|
30
|
+
"winston-daily-rotate-file": "^4.7.1"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"handlebars": "^4.7.8",
|
|
34
|
+
"public-ip": "^6.0.2",
|
|
35
|
+
"tiktoken": "^1.0.7",
|
|
31
36
|
"yaml": "^2.8.1"
|
|
32
37
|
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"handlebars": {
|
|
40
|
+
"optional": true
|
|
41
|
+
},
|
|
42
|
+
"public-ip": {
|
|
43
|
+
"optional": true
|
|
44
|
+
},
|
|
45
|
+
"tiktoken": {
|
|
46
|
+
"optional": true
|
|
47
|
+
},
|
|
48
|
+
"yaml": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
33
52
|
"devDependencies": {
|
|
34
53
|
"@deepkit/type": "^1.0.1-alpha.153",
|
|
35
54
|
"@types/jest": "^29.5.12",
|
|
@@ -39,7 +58,8 @@
|
|
|
39
58
|
"public-ip": "^6.0.2",
|
|
40
59
|
"tiktoken": "^1.0.7",
|
|
41
60
|
"tsc-alias": "^1.8.8",
|
|
42
|
-
"typescript": "^5.3.3"
|
|
61
|
+
"typescript": "^5.3.3",
|
|
62
|
+
"yaml": "^2.8.1"
|
|
43
63
|
},
|
|
44
64
|
"files": [
|
|
45
65
|
"dist",
|