@zwa73/utils 1.0.271 → 1.0.273
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/UtilClass/Hbs.d.ts +1 -1
- package/dist/UtilClass/Hbs.js +1 -1
- package/dist/UtilClass/Markdown.js +1 -1
- package/dist/UtilFileTools.d.ts +2 -2
- package/dist/UtilFileTools.js +4 -4
- package/dist/UtilFunctions.d.ts +2 -2
- package/dist/UtilFunctions.js +4 -4
- 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/UtilInterfaces.d.ts +1 -1
- package/dist/UtilLogger.d.ts +1 -1
- package/dist/UtilLogger.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +17 -1
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
|
*/
|
|
@@ -6,8 +6,8 @@ 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 UtilLogger_1 = require("../UtilLogger");
|
|
10
9
|
const yaml_1 = require("yaml");
|
|
10
|
+
const UtilLogger_1 = require("../UtilLogger");
|
|
11
11
|
const getMatter = async () => {
|
|
12
12
|
const matter = await js_utils_1.JsFunc.dynamicImport('gray-matter');
|
|
13
13
|
if (matter == undefined)
|
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,5 +1,5 @@
|
|
|
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];
|
|
@@ -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',
|
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/UtilInterfaces.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { JToken, JValue, JArray, JObject, IJData, AnyFunc, Keyable, DeepReadonly, DeepWritable, PartialOption, ProperSubset, ProperSubsetCheck, IncludeCheck, UnionCheck, Literal, LiteralCheck, AllExtends, AssignObject, Writeable, Inverted, FixedLengthTuple, Increment, RangeTuple, AnyString, UnionToIntersection, ExclusiveRecord, ExclusiveJObject, PromiseStatus, StatusVerifyFn, Await, FuncPropNames, ExtendThen, RequiredOnly, WithPrefix, Outcome, Either, Matchable, MatchableFlag, ExtractOutcome, ExtractMatchable, NeedInit, PRecord, MPromise, SPromise, SMPromise, NotPromise, AnyRecord, MReturnType, CmtTuple, Flasy, SrtSegment, ILogger, LogLevel, Asyncize, SharpSchema, ExpandSharpSchema, Preset, PresetOption, PresetFinal } from "@zwa73/js-utils";
|
|
1
|
+
export type { JToken, JValue, JArray, JObject, IJData, AnyFunc, Keyable, DeepReadonly, DeepWritable, PartialOption, ProperSubset, ProperSubsetCheck, IncludeCheck, UnionCheck, Literal, LiteralCheck, AllExtends, AssignObject, Writeable, Requireify, Inverted, FixedLengthTuple, Increment, RangeTuple, AnyString, UnionToIntersection, ExclusiveRecord, ExclusiveJObject, PromiseStatus, StatusVerifyFn, Await, FuncPropNames, ExtendThen, RequiredOnly, WithPrefix, Outcome, Either, Matchable, MatchableFlag, ExtractOutcome, ExtractMatchable, NeedInit, PRecord, MPromise, SPromise, SMPromise, NotPromise, AnyRecord, MReturnType, CmtTuple, Flasy, SrtSegment, ILogger, LogLevel, Asyncize, SharpSchema, ExpandSharpSchema, Preset, PresetOption, PresetFinal } from "@zwa73/js-utils";
|
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.273",
|
|
4
4
|
"description": "my utils",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,6 +30,22 @@
|
|
|
30
30
|
"winston-daily-rotate-file": "^4.7.1",
|
|
31
31
|
"yaml": "^2.8.1"
|
|
32
32
|
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"handlebars": "^4.7.8",
|
|
35
|
+
"public-ip": "^6.0.2",
|
|
36
|
+
"tiktoken": "^1.0.7"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"handlebars": {
|
|
40
|
+
"optional": true
|
|
41
|
+
},
|
|
42
|
+
"public-ip": {
|
|
43
|
+
"optional": true
|
|
44
|
+
},
|
|
45
|
+
"tiktoken": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
33
49
|
"devDependencies": {
|
|
34
50
|
"@deepkit/type": "^1.0.1-alpha.153",
|
|
35
51
|
"@types/jest": "^29.5.12",
|