@gerync/utils 1.2.1 → 1.2.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Colorlog.d.ts","sourceRoot":"","sources":["../../functions/Colorlog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI,CAuJvH"}
1
+ {"version":3,"file":"Colorlog.d.ts","sourceRoot":"","sources":["../../functions/Colorlog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI,CA0JvH"}
@@ -26,9 +26,8 @@ export default function Coloredlog(message, color, bolded = false) {
26
26
  /** CSS named colors (e.g., 'red', 'blue', 'aliceblue') */
27
27
  named: /^(?:aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|mineskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mincream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|palegoldenrod|palegreen|palevioletred)$/i,
28
28
  };
29
- // #endregion
30
- // #region Helpers for Node console coloring
31
- const isBrowser = typeof globalThis !== 'undefined' && typeof globalThis.document !== 'undefined';
29
+ const isBrowser = typeof globalThis !== 'undefined' &&
30
+ typeof globalThis.document !== 'undefined';
32
31
  const namedAnsi = {
33
32
  black: '\x1b[30m',
34
33
  red: '\x1b[31m',
@@ -1,3 +1,4 @@
1
1
  export declare function encryptData(data: string, key: string): string;
2
2
  export declare function decryptData(data: string, key: string): string;
3
+ export declare function HashData(data: string): string;
3
4
  //# sourceMappingURL=Encrypt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Encrypt.d.ts","sourceRoot":"","sources":["../../functions/Encrypt.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAM7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ7D"}
1
+ {"version":3,"file":"Encrypt.d.ts","sourceRoot":"","sources":["../../functions/Encrypt.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAM7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C"}
@@ -15,3 +15,6 @@ export function decryptData(data, key) {
15
15
  decrypted += decipher.final('utf8');
16
16
  return decrypted;
17
17
  }
18
+ export function HashData(data) {
19
+ return crypto.createHash('sha256').update(data).digest('hex');
20
+ }
package/package.json CHANGED
@@ -1,62 +1,65 @@
1
- {
2
- "name": "@gerync/utils",
3
- "version": "1.2.1",
4
- "description": "A collection of utilities for any type of project, providing logging, error handling, configuration management, and object manipulation helpers.",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "README.md",
17
- "LICENSE",
18
- "SECURITY.md"
19
- ],
20
- "scripts": {
21
- "build": "tsc",
22
- "prepublishOnly": "npm run build",
23
- "test": "vitest run",
24
- "test:watch": "vitest"
25
- },
26
- "keywords": [
27
- "utilities",
28
- "error-handling",
29
- "logging",
30
- "express",
31
- "middleware",
32
- "validation",
33
- "configuration",
34
- "i18n",
35
- "object-manipulation",
36
- "typescript",
37
- "multi-language",
38
- "utils",
39
- "multilingual"
40
- ],
41
- "author": "gerync",
42
- "license": "MIT",
43
- "repository": {
44
- "type": "git",
45
- "url": "https://github.com/gerync/utils.git"
46
- },
47
- "bugs": {
48
- "url": "https://github.com/gerync/utils/issues"
49
- },
50
- "homepage": "https://github.com/gerync/utils#readme",
51
- "peerDependencies": {
52
- "express": "^5.0.0"
53
- },
54
- "dependencies": {},
55
- "devDependencies": {
56
- "@types/node": "^20.11.30",
57
- "@types/express": "^4.17.21",
58
- "express": "^5.2.1",
59
- "typescript": "^5.6.3",
60
- "vitest": "^1.6.0"
61
- }
62
- }
1
+ {
2
+ "name": "@gerync/utils",
3
+ "version": "1.2.2",
4
+ "description": "A collection of utilities for any type of project, providing logging, error handling, configuration management, and object manipulation helpers.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE",
18
+ "SECURITY.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "prepublishOnly": "npm run build",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest"
25
+ },
26
+ "keywords": [
27
+ "utilities",
28
+ "error-handling",
29
+ "logging",
30
+ "express",
31
+ "middleware",
32
+ "validation",
33
+ "configuration",
34
+ "i18n",
35
+ "object-manipulation",
36
+ "typescript",
37
+ "multi-language",
38
+ "utils",
39
+ "multilingual"
40
+ ],
41
+ "author": "gerync",
42
+ "license": "MIT",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/gerync/utils.git"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/gerync/utils/issues"
49
+ },
50
+ "homepage": "https://github.com/gerync/utils#readme",
51
+ "peerDependencies": {
52
+ "express": "^5.0.0"
53
+ },
54
+ "dependencies": {
55
+ "jsonwebtoken": "^9.0.3"
56
+ },
57
+ "devDependencies": {
58
+ "@types/bun": "latest",
59
+ "@types/express": "^4.17.21",
60
+ "@types/node": "^20.11.30",
61
+ "express": "^5.2.1",
62
+ "typescript": "^5.6.3",
63
+ "vitest": "^1.6.0"
64
+ }
65
+ }