@aitianyu.cn/types 0.0.5 → 0.0.6

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 (47) hide show
  1. package/dist/lib/index.js +50 -50
  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/object/Calculater.js +230 -230
  20. package/dist/lib/utilities/core/object/Helper.js +201 -201
  21. package/dist/lib/utilities/security/Guid.js +17 -17
  22. package/dist/lib/utilities/security/Hash.js +15 -15
  23. package/dist/lib/utilities/security/index.js +8 -8
  24. package/dist/types/index.d.ts +19 -19
  25. package/dist/types/types/AreaCode.d.ts +135 -135
  26. package/dist/types/types/Exception.d.ts +11 -11
  27. package/dist/types/types/Logs.d.ts +64 -64
  28. package/dist/types/types/Object.d.ts +18 -18
  29. package/dist/types/types/PathBase.d.ts +76 -76
  30. package/dist/types/types/Security.d.ts +23 -23
  31. package/dist/types/types/TMap.d.ts +80 -80
  32. package/dist/types/types/Types.d.ts +20 -20
  33. package/dist/types/types/index.d.ts +9 -9
  34. package/dist/types/utilities/coding/Error.d.ts +27 -27
  35. package/dist/types/utilities/coding/Path.d.ts +61 -61
  36. package/dist/types/utilities/coding/index.d.ts +3 -3
  37. package/dist/types/utilities/core/Errors.d.ts +47 -47
  38. package/dist/types/utilities/core/Language.d.ts +17 -17
  39. package/dist/types/utilities/core/Log.d.ts +12 -12
  40. package/dist/types/utilities/core/TypeConvertion.d.ts +2 -2
  41. package/dist/types/utilities/core/index.d.ts +6 -6
  42. package/dist/types/utilities/core/object/Calculater.d.ts +22 -22
  43. package/dist/types/utilities/core/object/Helper.d.ts +39 -39
  44. package/dist/types/utilities/security/Guid.d.ts +3 -3
  45. package/dist/types/utilities/security/Hash.d.ts +3 -3
  46. package/dist/types/utilities/security/index.d.ts +3 -3
  47. package/package.json +51 -51
@@ -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,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.5",
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.6",
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
+ }