@hugoalh/github-sodium 6.0.3 → 6.0.5

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/_polyfill.d.ts CHANGED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=_polyfill.d.ts.map
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=cli.d.ts.map
package/libsodium/cli.js CHANGED
@@ -1,25 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { exit } from "node:process";
2
+ import process from "node:process";
3
3
  import { parseArgs, styleText } from "node:util";
4
4
  import { GitHubSodiumSealer } from "../libsodium.js";
5
5
  if (!import.meta.main) {
6
6
  throw new Error(`This entrypoint is for command line only!`);
7
7
  }
8
- addEventListener("unhandledrejection", (event) => {
9
- event.preventDefault();
10
- let message;
11
- if (event.reason instanceof Error) {
12
- message = event.reason.message;
13
- if ((event.reason.stack ?? "").length > 0) {
14
- message += `\n${event.reason.stack}`;
15
- }
16
- }
17
- else {
18
- message = String(event.reason);
8
+ process.addListener("uncaughtException", (error) => {
9
+ let message = error.message;
10
+ if ((error.stack ?? "").length > 0) {
11
+ message += `\n${error.stack}`;
19
12
  }
20
13
  console.error(`${styleText(["red"], "ERROR", { validateStream: false })}\t${message}`);
21
- exit(1);
22
- }, { capture: true });
14
+ process.exit(1);
15
+ });
23
16
  const { positionals } = parseArgs({ allowPositionals: true });
24
17
  if (positionals.length !== 2) {
25
18
  throw new Error(`Invalid arguments length! Expect: 2, Current: ${positionals.length}.`);
package/libsodium.d.ts CHANGED
@@ -18,4 +18,3 @@ export declare class GitHubSodiumSealer {
18
18
  encrypt(value: string): string;
19
19
  }
20
20
  export default GitHubSodiumSealer;
21
- //# sourceMappingURL=libsodium.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hugoalh/github-sodium",
3
- "version": "6.0.3",
3
+ "version": "6.0.5",
4
4
  "description": "A module to provide an easier and simplified method for encrypt GitHub secrets.",
5
5
  "keywords": [
6
6
  "github",
@@ -22,40 +22,28 @@
22
22
  "module": "./libsodium.js",
23
23
  "exports": {
24
24
  "./cli": {
25
- "import": {
26
- "types": "./libsodium/cli.d.ts",
27
- "default": "./libsodium/cli.js"
28
- }
25
+ "types": "./libsodium/cli.d.ts",
26
+ "default": "./libsodium/cli.js"
29
27
  },
30
28
  "./libsodium": {
31
- "import": {
32
- "types": "./libsodium.d.ts",
33
- "default": "./libsodium.js"
34
- }
29
+ "types": "./libsodium.d.ts",
30
+ "default": "./libsodium.js"
35
31
  },
36
32
  "./libsodium/cli": {
37
- "import": {
38
- "types": "./libsodium/cli.d.ts",
39
- "default": "./libsodium/cli.js"
40
- }
33
+ "types": "./libsodium/cli.d.ts",
34
+ "default": "./libsodium/cli.js"
41
35
  },
42
36
  "./tweetsodium": {
43
- "import": {
44
- "types": "./tweetsodium.d.ts",
45
- "default": "./tweetsodium.js"
46
- }
37
+ "types": "./tweetsodium.d.ts",
38
+ "default": "./tweetsodium.js"
47
39
  },
48
40
  "./tweetsodium/cli": {
49
- "import": {
50
- "types": "./tweetsodium/cli.d.ts",
51
- "default": "./tweetsodium/cli.js"
52
- }
41
+ "types": "./tweetsodium/cli.d.ts",
42
+ "default": "./tweetsodium/cli.js"
53
43
  },
54
44
  ".": {
55
- "import": {
56
- "types": "./libsodium.d.ts",
57
- "default": "./libsodium.js"
58
- }
45
+ "types": "./libsodium.d.ts",
46
+ "default": "./libsodium.js"
59
47
  }
60
48
  },
61
49
  "types": "./libsodium.d.ts",
@@ -64,8 +52,8 @@
64
52
  "url": "git+https://github.com/hugoalh/github-sodium-es.git"
65
53
  },
66
54
  "dependencies": {
67
- "@hugoalh/blake": "^0.2.2",
68
- "@hugoalh/nacl": "^0.2.1",
55
+ "@hugoalh/blake": "^0.3.1",
56
+ "@hugoalh/nacl": "^0.2.2",
69
57
  "es-arraybuffer-base64": "^1.1.2",
70
58
  "libsodium-wrappers": "^0.8.4"
71
59
  },
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=cli.d.ts.map
@@ -1,25 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { exit } from "node:process";
2
+ import process from "node:process";
3
3
  import { parseArgs, styleText } from "node:util";
4
4
  import { GitHubSodiumSealer } from "../tweetsodium.js";
5
5
  if (!import.meta.main) {
6
6
  throw new Error(`This entrypoint is for command line only!`);
7
7
  }
8
- addEventListener("unhandledrejection", (event) => {
9
- event.preventDefault();
10
- let message;
11
- if (event.reason instanceof Error) {
12
- message = event.reason.message;
13
- if ((event.reason.stack ?? "").length > 0) {
14
- message += `\n${event.reason.stack}`;
15
- }
16
- }
17
- else {
18
- message = String(event.reason);
8
+ process.addListener("uncaughtException", (error) => {
9
+ let message = error.message;
10
+ if ((error.stack ?? "").length > 0) {
11
+ message += `\n${error.stack}`;
19
12
  }
20
13
  console.error(`${styleText(["red"], "ERROR", { validateStream: false })}\t${message}`);
21
- exit(1);
22
- }, { capture: true });
14
+ process.exit(1);
15
+ });
23
16
  const { positionals } = parseArgs({ allowPositionals: true });
24
17
  if (positionals.length !== 2) {
25
18
  throw new Error(`Invalid arguments length! Expect: 2, Current: ${positionals.length}.`);
package/tweetsodium.d.ts CHANGED
@@ -18,4 +18,3 @@ export declare class GitHubSodiumSealer {
18
18
  encrypt(value: string): string;
19
19
  }
20
20
  export default GitHubSodiumSealer;
21
- //# sourceMappingURL=tweetsodium.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_polyfill.d.ts","sourceRoot":"","sources":["src/_polyfill.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/libsodium/cli.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"libsodium.d.ts","sourceRoot":"","sources":["src/libsodium.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAExB;;GAEG;AACH,qBAAa,kBAAkB;;IAC9B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED;;;OAGG;gBACS,SAAS,EAAE,MAAM;IAM7B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAM9B;AACD,eAAe,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/tweetsodium/cli.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tweetsodium.d.ts","sourceRoot":"","sources":["src/tweetsodium.ts"],"names":[],"mappings":"AASA,OAAO,gBAAgB,CAAC;AAExB;;GAEG;AACH,qBAAa,kBAAkB;;IAC9B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED;;;OAGG;gBACS,SAAS,EAAE,MAAM;IAM7B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAe9B;AACD,eAAe,kBAAkB,CAAC"}