@zwa73/utils 1.0.286 → 1.0.288
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.
|
@@ -32,13 +32,3 @@ export declare class JsonStore<T extends JObject> implements DataStore<T> {
|
|
|
32
32
|
*/
|
|
33
33
|
getUid(): string;
|
|
34
34
|
}
|
|
35
|
-
/**可解析的数据存储源 */
|
|
36
|
-
export type ParseableDataStore<T> = string | T | DataStore<T>;
|
|
37
|
-
/**常用的数据存储实现 */
|
|
38
|
-
export declare class UtilDataStore {
|
|
39
|
-
/**解析数据存储器源
|
|
40
|
-
* @param source 数据存储源
|
|
41
|
-
* @returns 数据存储对象
|
|
42
|
-
*/
|
|
43
|
-
static parseDataStore<T>(source: ParseableDataStore<T>): DataStore<T>;
|
|
44
|
-
}
|
|
@@ -3,9 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.JsonStore = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const js_utils_1 = require("@zwa73/js-utils");
|
|
9
8
|
const UtilFileTools_1 = require("../UtilFileTools");
|
|
10
9
|
const UtilFunctions_1 = require("../UtilFunctions");
|
|
11
10
|
const UtilLogger_1 = require("../UtilLogger");
|
|
@@ -66,19 +65,3 @@ class JsonStore {
|
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
exports.JsonStore = JsonStore;
|
|
69
|
-
/**常用的数据存储实现 */
|
|
70
|
-
class UtilDataStore {
|
|
71
|
-
/**解析数据存储器源
|
|
72
|
-
* @param source 数据存储源
|
|
73
|
-
* @returns 数据存储对象
|
|
74
|
-
*/
|
|
75
|
-
static parseDataStore(source) {
|
|
76
|
-
if (typeof source == 'string')
|
|
77
|
-
return new JsonStore({ filepath: source });
|
|
78
|
-
if (typeof source == 'object' && source != null && 'save' in source &&
|
|
79
|
-
typeof source.save == 'function')
|
|
80
|
-
return source;
|
|
81
|
-
return new js_utils_1.ObjectStore({ data: source });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.UtilDataStore = UtilDataStore;
|
package/dist/UtilCodecs.js
CHANGED
|
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.UtilCodec = void 0;
|
|
27
|
-
const Constant_1 = require("./Constant");
|
|
28
27
|
const he = __importStar(require("html-entities"));
|
|
28
|
+
const Constant_1 = require("./Constant");
|
|
29
29
|
/**引入tiktoken
|
|
30
30
|
* 依赖于 tiktoken@1.0.7 但不会自动安装
|
|
31
31
|
*/
|
package/dist/UtilDecorators.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { ParamsDecoratorsGener, BaseDecoratorsGener, LogTraceOpt, PostProcessOpt } from "@zwa73/js-utils";
|
|
1
|
+
export type { ParamsDecoratorsGener, BaseDecoratorsGener, StandardMethodDecorator, LogTraceOpt, PostProcessOpt } from "@zwa73/js-utils";
|
|
2
2
|
export { LogTrace, PostProcess, AwaitInited } from "@zwa73/js-utils";
|
package/dist/UtilFunctions.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataStore } from "@zwa73/js-utils";
|
|
1
2
|
import { JsFunc } from "@zwa73/js-utils";
|
|
2
3
|
import type { AnyString, LogLevel } from "./UtilInterfaces";
|
|
3
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"];
|
|
@@ -16,6 +17,8 @@ type ExecOpt = Partial<{
|
|
|
16
17
|
/**额外环境变量 */
|
|
17
18
|
env: string;
|
|
18
19
|
}>;
|
|
20
|
+
/**可解析的数据存储源 */
|
|
21
|
+
export type ParseableDataStore<T> = string | T | DataStore<T>;
|
|
19
22
|
/**常用函数 */
|
|
20
23
|
declare class _UtilFunc {
|
|
21
24
|
/**计算Hash
|
|
@@ -48,7 +51,12 @@ declare class _UtilFunc {
|
|
|
48
51
|
* 依赖于 public-ip@6.0.2 但不会自动安装
|
|
49
52
|
*/
|
|
50
53
|
static getPublicIpv4(): Promise<string>;
|
|
54
|
+
/**解析数据存储器源
|
|
55
|
+
* @param source 数据存储源
|
|
56
|
+
* @returns 数据存储对象
|
|
57
|
+
*/
|
|
58
|
+
static resolveDataStore<T>(source: ParseableDataStore<T>): DataStore<T>;
|
|
51
59
|
}
|
|
52
|
-
export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "
|
|
60
|
+
export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "prototype" | "preset" | "assignOption" | "genUUID" | "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" | "success" | "failed" | "match" | "isStatus" | "eitherize" | "parseSrtTime" | "formatSrtTime" | "parseSrt" | "createSrt" | "ivk" | "range" | "s2l" | "l2s">;
|
|
53
61
|
export type UtilFunc = typeof UtilFunc;
|
|
54
62
|
export {};
|
package/dist/UtilFunctions.js
CHANGED
|
@@ -34,6 +34,7 @@ const js_utils_1 = require("@zwa73/js-utils");
|
|
|
34
34
|
const modular_mixer_1 = require("@zwa73/modular-mixer");
|
|
35
35
|
const UtilSymbol_1 = require("./UtilSymbol");
|
|
36
36
|
const Constant_1 = require("./Constant");
|
|
37
|
+
const UtilClass_1 = require("./UtilClass");
|
|
37
38
|
const UtilFileTools_1 = require("./UtilFileTools");
|
|
38
39
|
const UtilLogger_1 = require("./UtilLogger");
|
|
39
40
|
const HashAlgorithmList = [
|
|
@@ -138,6 +139,18 @@ class _UtilFunc {
|
|
|
138
139
|
});
|
|
139
140
|
return pip.publicIpv4();
|
|
140
141
|
}
|
|
142
|
+
/**解析数据存储器源
|
|
143
|
+
* @param source 数据存储源
|
|
144
|
+
* @returns 数据存储对象
|
|
145
|
+
*/
|
|
146
|
+
static resolveDataStore(source) {
|
|
147
|
+
if (typeof source == 'string')
|
|
148
|
+
return new UtilClass_1.JsonStore({ filepath: source });
|
|
149
|
+
if (typeof source == 'object' && source != null && 'save' in source &&
|
|
150
|
+
typeof source.save == 'function')
|
|
151
|
+
return source;
|
|
152
|
+
return new js_utils_1.ObjectStore({ data: source });
|
|
153
|
+
}
|
|
141
154
|
}
|
|
142
155
|
const key = '__jsUtils';
|
|
143
156
|
const fieldList = Object.getOwnPropertyNames(js_utils_1.JsFunc).filter(k => !['length', 'prototype', 'name'].includes(k));
|