tinyhmacmd5 0.0.6 → 0.0.7

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 (3) hide show
  1. package/main.d.ts +2 -2
  2. package/main.js +5 -2
  3. package/package.json +4 -3
package/main.d.ts CHANGED
@@ -9,8 +9,8 @@
9
9
  * @param {boolean} [raw] If true, the hash is returned as raw bytes (Uint8Array); otherwise, as a hex string.
10
10
  * @returns {string | Uint8Array<ArrayBuffer>} The MD5 (or HMAC‑MD5) digest, either as a hex string or a Uint8Array.
11
11
  */
12
- var md5: {
12
+ declare var md5: {
13
13
  (data: string | Uint8Array, key?: string | Uint8Array | null, raw?: false): string;
14
- (data: string | Uint8Array, key?: string | Uint8Array | null, raw: true): Uint8Array<ArrayBuffer>;
14
+ (data: string | Uint8Array, key: string | Uint8Array | null | undefined, raw: true): Uint8Array<ArrayBuffer>;
15
15
  };
16
16
  export default md5;
package/main.js CHANGED
@@ -36,7 +36,10 @@ let binlMD5 = (
36
36
  oi,
37
37
  output = [A, B, C, D],
38
38
  oldOutput = [...output],
39
- o = (/**@type {*}*/ _) => output[++oi & 3],
39
+ o = (
40
+ /** @param {*} [_] */
41
+ _ => output[++oi & 3]
42
+ ),
40
43
  ) => {
41
44
 
42
45
  // append padding
@@ -116,7 +119,7 @@ let inputToBinl = (
116
119
  /**
117
120
  * @overload
118
121
  * @param {string | Uint8Array} data
119
- * @param {string | Uint8Array | null} [key]
122
+ * @param {string | Uint8Array | null | undefined} key
120
123
  * @param {true} raw
121
124
  * @returns {Uint8Array<ArrayBuffer>}
122
125
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinyhmacmd5",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "A tiny JavaScript HMAC-MD5 implementation. The minified browser bundle is only 965 bytes.",
5
5
  "author": "bddjr",
6
6
  "license": "MIT",
@@ -32,10 +32,11 @@
32
32
  "devDependencies": {
33
33
  "es-check": "^9.6.4",
34
34
  "terser": "^5.49.0",
35
- "tinyhmacmd5": "link:"
35
+ "tinyhmacmd5": "link:",
36
+ "typescript": "^7.0.2"
36
37
  },
37
38
  "scripts": {
38
- "build": "node scripts/build.mjs && es-check es2021 --module --checkFeatures main.js browser.min.js",
39
+ "build": "tsc && node scripts/build.mjs && es-check es2021 --module --checkFeatures main.js browser.min.js",
39
40
  "test": "pnpm build && node scripts/test.mjs"
40
41
  }
41
42
  }