@hugoalh/github-sodium 1.1.5 → 1.1.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.
@@ -0,0 +1,10 @@
1
+ export default githubSodium;
2
+ /**
3
+ * @function githubSodium
4
+ * @description Encrypt value to GitHub secret value.
5
+ * @param {string} publicKey Organization's or repository's public key, which need for encrypt value to secret value before create or update a secret.
6
+ * @param {string} value Value that need to encrypt as secret value.
7
+ * @returns {string} An encrypted GitHub secret value.
8
+ */
9
+ declare function githubSodium(publicKey: string, value: string): string;
10
+ //# sourceMappingURL=main.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.mts","sourceRoot":"","sources":["../lib/main.mjs"],"names":[],"mappings":";AACA;;;;;;GAMG;AACH,yCAJW,MAAM,SACN,MAAM,GACJ,MAAM,CAgBlB"}
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # GitHub Sodium (NodeJS Edition)
1
+ # GitHub Sodium (NodeJS)
2
2
 
3
3
  [`GitHubSodium.NodeJS`](https://github.com/hugoalh-studio/github-sodium-nodejs)
4
4
  [![GitHub Contributors](https://img.shields.io/github/contributors/hugoalh-studio/github-sodium-nodejs?label=Contributors&logo=github&logoColor=ffffff&style=flat-square)](https://github.com/hugoalh-studio/github-sodium-nodejs/graphs/contributors)
package/lib/main.js CHANGED
@@ -11,13 +11,13 @@ function githubSodium(publicKey, value) {
11
11
  typeof publicKey !== "string" ||
12
12
  publicKey.length === 0
13
13
  ) {
14
- throw new TypeError(`Argument \`publicKey\` must be type of string (non-nullable)!`);
14
+ throw new TypeError(`Argument \`publicKey\` must be type of string (non-empty)!`);
15
15
  };
16
16
  if (
17
17
  typeof value !== "string" ||
18
18
  value.length === 0
19
19
  ) {
20
- throw new TypeError(`Argument \`value\` must be type of string (non-nullable)!`);
20
+ throw new TypeError(`Argument \`value\` must be type of string (non-empty)!`);
21
21
  };
22
22
  return Buffer.from(sodium.seal(Buffer.from(value), Buffer.from(publicKey, "base64"))).toString("base64");
23
23
  };
package/lib/main.mjs CHANGED
@@ -11,13 +11,13 @@ function githubSodium(publicKey, value) {
11
11
  typeof publicKey !== "string" ||
12
12
  publicKey.length === 0
13
13
  ) {
14
- throw new TypeError(`Argument \`publicKey\` must be type of string (non-nullable)!`);
14
+ throw new TypeError(`Argument \`publicKey\` must be type of string (non-empty)!`);
15
15
  };
16
16
  if (
17
17
  typeof value !== "string" ||
18
18
  value.length === 0
19
19
  ) {
20
- throw new TypeError(`Argument \`value\` must be type of string (non-nullable)!`);
20
+ throw new TypeError(`Argument \`value\` must be type of string (non-empty)!`);
21
21
  };
22
22
  return Buffer.from(sodium.seal(Buffer.from(value), Buffer.from(publicKey, "base64"))).toString("base64");
23
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hugoalh/github-sodium",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "A module to provide an easier sodium for GitHub secret.",
5
5
  "keywords": [
6
6
  "github",