@aitianyu.cn/types 0.0.13 → 0.1.0
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/lib/{utilities/coding → coding}/Error.js +44 -44
- package/dist/lib/{utilities/coding → coding}/Path.js +210 -198
- package/dist/lib/{utilities/core → core}/Errors.js +86 -86
- package/dist/lib/{utilities/core → core}/Language.js +561 -559
- package/dist/lib/{utilities/core → core}/Log.js +112 -108
- package/dist/lib/{utilities/core → core}/TypeConvertion.js +25 -25
- package/dist/lib/{utilities/core → core}/interface/ITJSON.js +3 -3
- package/dist/lib/{utilities/core → core}/interface/ITianyuType.js +3 -3
- package/dist/lib/{utilities/core → core}/object/ArrayHelper.js +35 -35
- package/dist/lib/core/object/Bytes.js +21 -0
- package/dist/lib/{utilities/core → core}/object/Calculater.js +240 -230
- package/dist/lib/core/object/DataView.js +23 -0
- package/dist/lib/core/object/Integer.js +117 -0
- package/dist/lib/core/object/Json.js +35 -0
- package/dist/lib/{utilities/core/object/Helper.js → core/object/ObjectHelper.js} +202 -201
- package/dist/lib/core/object/StringHelper.js +61 -0
- package/dist/lib/{utilities/core → core}/type/TArray.js +8 -7
- package/dist/lib/{utilities/core → core}/type/TBoolean.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TJSON.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TNumber.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TObject.js +7 -7
- package/dist/lib/{utilities/core → core}/type/TString.js +7 -7
- package/dist/lib/index.js +70 -54
- package/dist/lib/security/Base32.js +104 -0
- package/dist/lib/security/Guid.js +26 -0
- package/dist/lib/{utilities/security → security}/Hash.js +16 -15
- package/dist/lib/security/QRCode.js +46 -0
- package/dist/lib/security/RSA.js +62 -0
- package/dist/lib/security/SHA.js +67 -0
- package/dist/lib/types/AreaCode.js +269 -269
- package/dist/lib/types/Exception.js +19 -19
- package/dist/lib/types/Logs.js +20 -20
- package/dist/lib/types/Object.js +3 -3
- package/dist/lib/types/PathBase.js +109 -109
- package/dist/lib/types/Security.js +10 -10
- package/dist/lib/types/TMap.js +139 -138
- package/dist/lib/types/Types.js +3 -3
- package/dist/lib/types/index.js +17 -17
- package/dist/types/{utilities/coding → coding}/Error.d.ts +27 -27
- package/dist/types/{utilities/coding → coding}/Path.d.ts +61 -61
- package/dist/types/{utilities/core → core}/Errors.d.ts +47 -47
- package/dist/types/{utilities/core → core}/Language.d.ts +17 -17
- package/dist/types/{utilities/core → core}/Log.d.ts +12 -12
- package/dist/types/{utilities/core → core}/TypeConvertion.d.ts +2 -2
- package/dist/types/{utilities/core → core}/interface/ITJSON.d.ts +5 -5
- package/dist/types/{utilities/core → core}/interface/ITianyuType.d.ts +5 -5
- package/dist/types/{utilities/core → core}/object/ArrayHelper.d.ts +11 -11
- package/dist/types/core/object/Bytes.d.ts +13 -0
- package/dist/types/{utilities/core → core}/object/Calculater.d.ts +22 -22
- package/dist/types/core/object/DataView.d.ts +11 -0
- package/dist/types/core/object/Integer.d.ts +71 -0
- package/dist/types/core/object/Json.d.ts +22 -0
- package/dist/types/{utilities/core/object/Helper.d.ts → core/object/ObjectHelper.d.ts} +39 -39
- package/dist/types/core/object/StringHelper.d.ts +21 -0
- package/dist/types/{utilities/core → core}/type/TArray.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TBoolean.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TJSON.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TNumber.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TObject.d.ts +3 -3
- package/dist/types/{utilities/core → core}/type/TString.d.ts +3 -3
- package/dist/types/index.d.ts +29 -21
- package/dist/types/security/Base32.d.ts +42 -0
- package/dist/types/security/Guid.d.ts +4 -0
- package/dist/types/{utilities/security → security}/Hash.d.ts +3 -3
- package/dist/types/security/QRCode.d.ts +11 -0
- package/dist/types/security/RSA.d.ts +68 -0
- package/dist/types/security/SHA.d.ts +40 -0
- package/dist/types/types/AreaCode.d.ts +135 -135
- package/dist/types/types/Exception.d.ts +11 -11
- package/dist/types/types/Logs.d.ts +64 -64
- package/dist/types/types/Object.d.ts +18 -18
- package/dist/types/types/PathBase.d.ts +76 -76
- package/dist/types/types/Security.d.ts +23 -23
- package/dist/types/types/TMap.d.ts +80 -80
- package/dist/types/types/Types.d.ts +25 -25
- package/dist/types/types/index.d.ts +9 -9
- package/package.json +57 -51
- package/dist/lib/utilities/coding/index.js +0 -10
- package/dist/lib/utilities/core/index.js +0 -21
- package/dist/lib/utilities/core/object/StringHelper.js +0 -22
- package/dist/lib/utilities/security/Guid.js +0 -20
- package/dist/lib/utilities/security/index.js +0 -8
- package/dist/types/utilities/coding/index.d.ts +0 -3
- package/dist/types/utilities/core/index.d.ts +0 -6
- package/dist/types/utilities/core/object/StringHelper.d.ts +0 -4
- package/dist/types/utilities/security/Guid.d.ts +0 -3
- package/dist/types/utilities/security/index.d.ts +0 -3
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**@format */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ObjectDiffMergeFailedException = exports.ObjectDiffApplyInvalidStatusException = exports.ObjectMergeStatusCheckFailedException = exports.ObjectCloneFunctionNotSupportException = exports.ArgumentNullOrEmptyException = void 0;
|
|
5
|
-
const Exception_1 = require("
|
|
6
|
-
/** Argument null exception */
|
|
7
|
-
class ArgumentNullOrEmptyException extends Exception_1.Exception {
|
|
8
|
-
constructor(msg) {
|
|
9
|
-
super(msg);
|
|
10
|
-
}
|
|
11
|
-
toString() {
|
|
12
|
-
return `参数错误 - 指定的参数 ( ${this.message} ) 为空`;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ArgumentNullOrEmptyException = ArgumentNullOrEmptyException;
|
|
16
|
-
/**
|
|
17
|
-
* Object Clone:
|
|
18
|
-
* Function type is not supported.
|
|
19
|
-
* Exception will be thrown if try to clone a function type object
|
|
20
|
-
*/
|
|
21
|
-
class ObjectCloneFunctionNotSupportException extends Exception_1.Exception {
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
}
|
|
25
|
-
toString() {
|
|
26
|
-
return `不支持的类型 - 正在克隆为Function类型不支持`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.ObjectCloneFunctionNotSupportException = ObjectCloneFunctionNotSupportException;
|
|
30
|
-
/**
|
|
31
|
-
* Object Clone:
|
|
32
|
-
* Object different status could not be matched.
|
|
33
|
-
* Exception will be thrown if the object diff could not to be merged
|
|
34
|
-
*/
|
|
35
|
-
class ObjectMergeStatusCheckFailedException extends Exception_1.Exception {
|
|
36
|
-
status;
|
|
37
|
-
path;
|
|
38
|
-
constructor(path, status) {
|
|
39
|
-
super();
|
|
40
|
-
this.path = path;
|
|
41
|
-
this.status = status === "add" ? "新增" : status === "del" ? "删除" : "修改";
|
|
42
|
-
}
|
|
43
|
-
toString() {
|
|
44
|
-
return `错误的合并状态 - ${this.status} 路径 ${this.path} 前后状态不一致`;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.ObjectMergeStatusCheckFailedException = ObjectMergeStatusCheckFailedException;
|
|
48
|
-
/**
|
|
49
|
-
* Object Clone:
|
|
50
|
-
* Object different status could not be applied.
|
|
51
|
-
* Exception will be thrown if the object diff could not to be applied
|
|
52
|
-
*/
|
|
53
|
-
class ObjectDiffApplyInvalidStatusException extends Exception_1.Exception {
|
|
54
|
-
value;
|
|
55
|
-
constructor(value) {
|
|
56
|
-
super();
|
|
57
|
-
this.value = value;
|
|
58
|
-
}
|
|
59
|
-
toString() {
|
|
60
|
-
let v2s = "";
|
|
61
|
-
try {
|
|
62
|
-
v2s = JSON.stringify(this.value);
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
v2s = v2s || `[${(typeof this.value).toString()}]`;
|
|
66
|
-
}
|
|
67
|
-
return `无效的状态 - 值 ${v2s} 不能应用指定的状态`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.ObjectDiffApplyInvalidStatusException = ObjectDiffApplyInvalidStatusException;
|
|
71
|
-
/**
|
|
72
|
-
* Object Clone:
|
|
73
|
-
* Object different merge failed.
|
|
74
|
-
* Exception will be thrown if the object element could not be accessed
|
|
75
|
-
*/
|
|
76
|
-
class ObjectDiffMergeFailedException extends Exception_1.Exception {
|
|
77
|
-
path;
|
|
78
|
-
constructor(path) {
|
|
79
|
-
super();
|
|
80
|
-
this.path = path;
|
|
81
|
-
}
|
|
82
|
-
toString() {
|
|
83
|
-
return `对象合并遇到问题 - 路径 ${this.path} 存在无法访问的对象`;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.ObjectDiffMergeFailedException = ObjectDiffMergeFailedException;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**@format */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ObjectDiffMergeFailedException = exports.ObjectDiffApplyInvalidStatusException = exports.ObjectMergeStatusCheckFailedException = exports.ObjectCloneFunctionNotSupportException = exports.ArgumentNullOrEmptyException = void 0;
|
|
5
|
+
const Exception_1 = require("../types/Exception");
|
|
6
|
+
/** Argument null exception */
|
|
7
|
+
class ArgumentNullOrEmptyException extends Exception_1.Exception {
|
|
8
|
+
constructor(msg) {
|
|
9
|
+
super(msg);
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `参数错误 - 指定的参数 ( ${this.message} ) 为空`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ArgumentNullOrEmptyException = ArgumentNullOrEmptyException;
|
|
16
|
+
/**
|
|
17
|
+
* Object Clone:
|
|
18
|
+
* Function type is not supported.
|
|
19
|
+
* Exception will be thrown if try to clone a function type object
|
|
20
|
+
*/
|
|
21
|
+
class ObjectCloneFunctionNotSupportException extends Exception_1.Exception {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
}
|
|
25
|
+
toString() {
|
|
26
|
+
return `不支持的类型 - 正在克隆为Function类型不支持`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ObjectCloneFunctionNotSupportException = ObjectCloneFunctionNotSupportException;
|
|
30
|
+
/**
|
|
31
|
+
* Object Clone:
|
|
32
|
+
* Object different status could not be matched.
|
|
33
|
+
* Exception will be thrown if the object diff could not to be merged
|
|
34
|
+
*/
|
|
35
|
+
class ObjectMergeStatusCheckFailedException extends Exception_1.Exception {
|
|
36
|
+
status;
|
|
37
|
+
path;
|
|
38
|
+
constructor(path, status) {
|
|
39
|
+
super();
|
|
40
|
+
this.path = path;
|
|
41
|
+
this.status = status === "add" ? "新增" : status === "del" ? "删除" : "修改";
|
|
42
|
+
}
|
|
43
|
+
toString() {
|
|
44
|
+
return `错误的合并状态 - ${this.status} 路径 ${this.path} 前后状态不一致`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ObjectMergeStatusCheckFailedException = ObjectMergeStatusCheckFailedException;
|
|
48
|
+
/**
|
|
49
|
+
* Object Clone:
|
|
50
|
+
* Object different status could not be applied.
|
|
51
|
+
* Exception will be thrown if the object diff could not to be applied
|
|
52
|
+
*/
|
|
53
|
+
class ObjectDiffApplyInvalidStatusException extends Exception_1.Exception {
|
|
54
|
+
value;
|
|
55
|
+
constructor(value) {
|
|
56
|
+
super();
|
|
57
|
+
this.value = value;
|
|
58
|
+
}
|
|
59
|
+
toString() {
|
|
60
|
+
let v2s = "";
|
|
61
|
+
try {
|
|
62
|
+
v2s = JSON.stringify(this.value);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
v2s = v2s || `[${(typeof this.value).toString()}]`;
|
|
66
|
+
}
|
|
67
|
+
return `无效的状态 - 值 ${v2s} 不能应用指定的状态`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.ObjectDiffApplyInvalidStatusException = ObjectDiffApplyInvalidStatusException;
|
|
71
|
+
/**
|
|
72
|
+
* Object Clone:
|
|
73
|
+
* Object different merge failed.
|
|
74
|
+
* Exception will be thrown if the object element could not be accessed
|
|
75
|
+
*/
|
|
76
|
+
class ObjectDiffMergeFailedException extends Exception_1.Exception {
|
|
77
|
+
path;
|
|
78
|
+
constructor(path) {
|
|
79
|
+
super();
|
|
80
|
+
this.path = path;
|
|
81
|
+
}
|
|
82
|
+
toString() {
|
|
83
|
+
return `对象合并遇到问题 - 路径 ${this.path} 存在无法访问的对象`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.ObjectDiffMergeFailedException = ObjectDiffMergeFailedException;
|