@aitianyu.cn/types 0.0.11 → 0.0.13

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.
Files changed (67) hide show
  1. package/dist/lib/index.js +54 -54
  2. package/dist/lib/types/AreaCode.js +269 -269
  3. package/dist/lib/types/Exception.js +19 -19
  4. package/dist/lib/types/Logs.js +20 -20
  5. package/dist/lib/types/Object.js +3 -3
  6. package/dist/lib/types/PathBase.js +109 -109
  7. package/dist/lib/types/Security.js +10 -10
  8. package/dist/lib/types/TMap.js +138 -138
  9. package/dist/lib/types/Types.js +3 -3
  10. package/dist/lib/types/index.js +17 -17
  11. package/dist/lib/utilities/coding/Error.js +44 -44
  12. package/dist/lib/utilities/coding/Path.js +198 -198
  13. package/dist/lib/utilities/coding/index.js +10 -10
  14. package/dist/lib/utilities/core/Errors.js +86 -86
  15. package/dist/lib/utilities/core/Language.js +559 -559
  16. package/dist/lib/utilities/core/Log.js +108 -108
  17. package/dist/lib/utilities/core/TypeConvertion.js +25 -25
  18. package/dist/lib/utilities/core/index.js +21 -21
  19. package/dist/lib/utilities/core/interface/ITJSON.js +3 -0
  20. package/dist/lib/utilities/core/interface/ITianyuType.js +3 -0
  21. package/dist/lib/utilities/core/object/ArrayHelper.js +35 -35
  22. package/dist/lib/utilities/core/object/Calculater.js +230 -230
  23. package/dist/lib/utilities/core/object/Helper.js +201 -201
  24. package/dist/lib/utilities/core/object/StringHelper.js +22 -22
  25. package/dist/lib/utilities/core/type/TArray.js +7 -0
  26. package/dist/lib/utilities/core/type/TBoolean.js +7 -0
  27. package/dist/lib/utilities/core/type/TJSON.js +7 -0
  28. package/dist/lib/utilities/core/type/TNumber.js +7 -0
  29. package/dist/lib/utilities/core/type/TObject.js +7 -0
  30. package/dist/lib/utilities/core/type/TString.js +7 -0
  31. package/dist/lib/utilities/security/Guid.js +20 -20
  32. package/dist/lib/utilities/security/Hash.js +15 -15
  33. package/dist/lib/utilities/security/index.js +8 -8
  34. package/dist/types/index.d.ts +21 -21
  35. package/dist/types/types/AreaCode.d.ts +135 -135
  36. package/dist/types/types/Exception.d.ts +11 -11
  37. package/dist/types/types/Logs.d.ts +64 -64
  38. package/dist/types/types/Object.d.ts +18 -18
  39. package/dist/types/types/PathBase.d.ts +76 -76
  40. package/dist/types/types/Security.d.ts +23 -23
  41. package/dist/types/types/TMap.d.ts +80 -80
  42. package/dist/types/types/Types.d.ts +25 -20
  43. package/dist/types/types/index.d.ts +9 -9
  44. package/dist/types/utilities/coding/Error.d.ts +27 -27
  45. package/dist/types/utilities/coding/Path.d.ts +61 -61
  46. package/dist/types/utilities/coding/index.d.ts +3 -3
  47. package/dist/types/utilities/core/Errors.d.ts +47 -47
  48. package/dist/types/utilities/core/Language.d.ts +17 -17
  49. package/dist/types/utilities/core/Log.d.ts +12 -12
  50. package/dist/types/utilities/core/TypeConvertion.d.ts +2 -2
  51. package/dist/types/utilities/core/index.d.ts +6 -6
  52. package/dist/types/utilities/core/interface/ITJSON.d.ts +5 -0
  53. package/dist/types/utilities/core/interface/ITianyuType.d.ts +5 -0
  54. package/dist/types/utilities/core/object/ArrayHelper.d.ts +11 -11
  55. package/dist/types/utilities/core/object/Calculater.d.ts +22 -22
  56. package/dist/types/utilities/core/object/Helper.d.ts +39 -39
  57. package/dist/types/utilities/core/object/StringHelper.d.ts +4 -4
  58. package/dist/types/utilities/core/type/TArray.d.ts +3 -0
  59. package/dist/types/utilities/core/type/TBoolean.d.ts +3 -0
  60. package/dist/types/utilities/core/type/TJSON.d.ts +3 -0
  61. package/dist/types/utilities/core/type/TNumber.d.ts +3 -0
  62. package/dist/types/utilities/core/type/TObject.d.ts +3 -0
  63. package/dist/types/utilities/core/type/TString.d.ts +3 -0
  64. package/dist/types/utilities/security/Guid.d.ts +3 -3
  65. package/dist/types/utilities/security/Hash.d.ts +3 -3
  66. package/dist/types/utilities/security/index.d.ts +3 -3
  67. package/package.json +51 -51
@@ -1,22 +1,22 @@
1
- /**@format */
2
- import { ObjectDiffMap } from "../../../types/Object";
3
- /** Object Calculation Manager of Tianyu to provide data changes delta calculation and merge */
4
- export declare class ObjectCalculater {
5
- /**
6
- * Compare two objects and get the delta changes between the two objects
7
- *
8
- * @param previous the previous object
9
- * @param newest the newest object
10
- * @returns return the defferents map
11
- */
12
- static calculateDiff(previous: any, newest: any): ObjectDiffMap;
13
- /**
14
- * Merge the object value status from one to another one following with the object different maps
15
- *
16
- * @param value the raw value(status)
17
- * @param diffs the value changed status map array, contains multiply status maps and the status merge will be one by one.
18
- * @param strict a boolean value used to whether the program needs a strict status check to avoid some data errors
19
- * @returns return a new value status
20
- */
21
- static mergeDiff(value: any, diffs: ObjectDiffMap[], strict?: boolean): any;
22
- }
1
+ /**@format */
2
+ import { ObjectDiffMap } from "../../../types/Object";
3
+ /** Object Calculation Manager of Tianyu to provide data changes delta calculation and merge */
4
+ export declare class ObjectCalculater {
5
+ /**
6
+ * Compare two objects and get the delta changes between the two objects
7
+ *
8
+ * @param previous the previous object
9
+ * @param newest the newest object
10
+ * @returns return the defferents map
11
+ */
12
+ static calculateDiff(previous: any, newest: any): ObjectDiffMap;
13
+ /**
14
+ * Merge the object value status from one to another one following with the object different maps
15
+ *
16
+ * @param value the raw value(status)
17
+ * @param diffs the value changed status map array, contains multiply status maps and the status merge will be one by one.
18
+ * @param strict a boolean value used to whether the program needs a strict status check to avoid some data errors
19
+ * @returns return a new value status
20
+ */
21
+ static mergeDiff(value: any, diffs: ObjectDiffMap[], strict?: boolean): any;
22
+ }
@@ -1,39 +1,39 @@
1
- /**@format */
2
- /** Object Helper of Tianyu to provide data type checking, objects comparing, validation, data clone and other functions */
3
- export declare class ObjectHelper {
4
- /**
5
- * check whether the specified value does extend from nodejs native type
6
- *
7
- * @param {any} value supported value type of tianyu store
8
- * @returns {boolean} return true if the value is based on type number, string, boolean, function, otherwise false
9
- */
10
- static isSimpleDataType(value: any): boolean;
11
- /**
12
- * get a deep copy from source
13
- *
14
- * @param {any} sources the specified source value
15
- * @returns {any} return a new value that is independent from sources
16
- */
17
- static clone(source: any): any;
18
- private static _clone;
19
- private static _cloneArray;
20
- private static _cloneRecordType;
21
- /**
22
- * Check the object whether can be stringified
23
- *
24
- * @param obj be checked object
25
- * @returns return true is valid, otherwise false
26
- */
27
- static validateSerializable(obj: any): boolean;
28
- /**
29
- * Compare two or more objects are the same or different
30
- *
31
- * @param objs the objects which need to be compared
32
- * @returns same - if all the objects are same, different - if at least one object is not same to other objects
33
- * @description if there are only one parameter or no parameter is provided, same result will be returned
34
- */
35
- static compareObjects(...objs: any): "same" | "different";
36
- private static _compareSimpleType;
37
- private static _compareArrayType;
38
- private static _compareObjectType;
39
- }
1
+ /**@format */
2
+ /** Object Helper of Tianyu to provide data type checking, objects comparing, validation, data clone and other functions */
3
+ export declare class ObjectHelper {
4
+ /**
5
+ * check whether the specified value does extend from nodejs native type
6
+ *
7
+ * @param {any} value supported value type of tianyu store
8
+ * @returns {boolean} return true if the value is based on type number, string, boolean, function, otherwise false
9
+ */
10
+ static isSimpleDataType(value: any): boolean;
11
+ /**
12
+ * get a deep copy from source
13
+ *
14
+ * @param {any} sources the specified source value
15
+ * @returns {any} return a new value that is independent from sources
16
+ */
17
+ static clone(source: any): any;
18
+ private static _clone;
19
+ private static _cloneArray;
20
+ private static _cloneRecordType;
21
+ /**
22
+ * Check the object whether can be stringified
23
+ *
24
+ * @param obj be checked object
25
+ * @returns return true is valid, otherwise false
26
+ */
27
+ static validateSerializable(obj: any): boolean;
28
+ /**
29
+ * Compare two or more objects are the same or different
30
+ *
31
+ * @param objs the objects which need to be compared
32
+ * @returns same - if all the objects are same, different - if at least one object is not same to other objects
33
+ * @description if there are only one parameter or no parameter is provided, same result will be returned
34
+ */
35
+ static compareObjects(...objs: any): "same" | "different";
36
+ private static _compareSimpleType;
37
+ private static _compareArrayType;
38
+ private static _compareObjectType;
39
+ }
@@ -1,4 +1,4 @@
1
- /**@format */
2
- export declare class StringHelper {
3
- static format(source: string, args?: (string | number)[] | string): string;
4
- }
1
+ /**@format */
2
+ export declare class StringHelper {
3
+ static format(source: string, args?: (string | number)[] | string): string;
4
+ }
@@ -0,0 +1,3 @@
1
+ /** @format */
2
+ export declare class TArray<T> {
3
+ }
@@ -0,0 +1,3 @@
1
+ /** @format */
2
+ export declare class TBoolean {
3
+ }
@@ -0,0 +1,3 @@
1
+ /** @format */
2
+ export declare class TJSON {
3
+ }
@@ -0,0 +1,3 @@
1
+ /** @format */
2
+ export declare class TNumber {
3
+ }
@@ -0,0 +1,3 @@
1
+ /** @format */
2
+ export declare class TObject {
3
+ }
@@ -0,0 +1,3 @@
1
+ /** @format */
2
+ export declare class TString {
3
+ }
@@ -1,3 +1,3 @@
1
- /**@format */
2
- /** Generate a Guid value string */
3
- export declare function guid(): string;
1
+ /**@format */
2
+ /** Generate a Guid value string */
3
+ export declare function guid(): string;
@@ -1,3 +1,3 @@
1
- /**@format */
2
- /** Generate a hash code number of the string */
3
- export declare function hash(source: string): number;
1
+ /**@format */
2
+ /** Generate a hash code number of the string */
3
+ export declare function hash(source: string): number;
@@ -1,3 +1,3 @@
1
- /**@format */
2
- export { guid } from "./Guid";
3
- export { hash } from "./Hash";
1
+ /**@format */
2
+ export { guid } from "./Guid";
3
+ export { hash } from "./Hash";
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
- {
2
- "name": "@aitianyu.cn/types",
3
- "version": "0.0.11",
4
- "private": false,
5
- "description": "Common modules (types, functions, classes) for aitianyu",
6
- "main": "./dist/lib/index.js",
7
- "types": "./dist/types/index.d.ts",
8
- "exports": {
9
- ".": "./dist/lib/index.js",
10
- "./types": "./dist/lib/types/index.js",
11
- "./coding": "./dist/lib/utilities/coding/index.js",
12
- "./core": "./dist/lib/utilities/core/index.js",
13
- "./security": "./dist/lib/utilities/security/index.js"
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "type": "commonjs",
19
- "keywords": [
20
- "aitianyu.cn",
21
- "base type",
22
- "common lib"
23
- ],
24
- "scripts": {
25
- "start": "ts-node packages/index.ts",
26
- "build": "npm run before-build && npm run compiler && npm run copy-lib && npm run copy-types && npm run after-build",
27
- "compiler": "tsc && tsc-alias",
28
- "copy-lib": "copyfiles -u 2 \"build/src/**/*.js\" \"dist/lib\"",
29
- "copy-types": "copyfiles -u 2 \"build/src/**/*.d.ts\" \"dist/types\"",
30
- "before-build": "rimraf ./dist ./build",
31
- "after-build": "rimraf ./build",
32
- "test": "jest --no-cache --verbose",
33
- "test-all": "jest --no-cache --verbose --coverage",
34
- "test-coverage": "jest --no-cache --coverage"
35
- },
36
- "author": "dev@aitianyu.cn",
37
- "license": "ISC",
38
- "devDependencies": {
39
- "@types/jest": "^29.2.4",
40
- "@types/node": "^18.11.15",
41
- "copyfiles": "^2.4.1",
42
- "jest": "^29.3.1",
43
- "jest-html-reporters": "^3.0.11",
44
- "perf_hooks": "0.0.1",
45
- "rimraf": "^3.0.2",
46
- "ts-jest": "^29.0.3",
47
- "ts-node": "^10.9.1",
48
- "tsc-alias": "^1.8.2",
49
- "typescript": "^4.9.3"
50
- }
51
- }
1
+ {
2
+ "name": "@aitianyu.cn/types",
3
+ "version": "0.0.13",
4
+ "private": false,
5
+ "description": "Common modules (types, functions, classes) for aitianyu",
6
+ "main": "./dist/lib/index.js",
7
+ "types": "./dist/types/index.d.ts",
8
+ "exports": {
9
+ ".": "./dist/lib/index.js",
10
+ "./types": "./dist/lib/types/index.js",
11
+ "./coding": "./dist/lib/utilities/coding/index.js",
12
+ "./core": "./dist/lib/utilities/core/index.js",
13
+ "./security": "./dist/lib/utilities/security/index.js"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "type": "commonjs",
19
+ "keywords": [
20
+ "aitianyu.cn",
21
+ "base type",
22
+ "common lib"
23
+ ],
24
+ "scripts": {
25
+ "start": "ts-node packages/index.ts",
26
+ "build": "npm run before-build && npm run compiler && npm run copy-lib && npm run copy-types && npm run after-build",
27
+ "compiler": "tsc && tsc-alias",
28
+ "copy-lib": "copyfiles -u 2 \"build/src/**/*.js\" \"dist/lib\"",
29
+ "copy-types": "copyfiles -u 2 \"build/src/**/*.d.ts\" \"dist/types\"",
30
+ "before-build": "rimraf ./dist ./build",
31
+ "after-build": "rimraf ./build",
32
+ "test": "jest --no-cache --verbose",
33
+ "test-all": "jest --no-cache --verbose --coverage",
34
+ "test-coverage": "jest --no-cache --coverage"
35
+ },
36
+ "author": "dev@aitianyu.cn",
37
+ "license": "ISC",
38
+ "devDependencies": {
39
+ "@types/jest": "^29.2.4",
40
+ "@types/node": "^18.11.15",
41
+ "copyfiles": "^2.4.1",
42
+ "jest": "^29.3.1",
43
+ "jest-html-reporters": "^3.0.11",
44
+ "perf_hooks": "0.0.1",
45
+ "rimraf": "^3.0.2",
46
+ "ts-jest": "^29.0.3",
47
+ "ts-node": "^10.9.1",
48
+ "tsc-alias": "^1.8.2",
49
+ "typescript": "^4.9.3"
50
+ }
51
+ }