Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit fca09d6

Browse files
committed
fix: update deps and fix err-code usage
1 parent 9bc7c0b commit fca09d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
},
3636
"dependencies": {
3737
"blakejs": "^1.1.0",
38-
"buffer": "^5.2.1",
39-
"err-code": "^1.1.2",
38+
"buffer": "^5.4.3",
39+
"err-code": "^2.0.0",
4040
"js-sha3": "~0.8.0",
4141
"multihashes": "~0.4.15",
4242
"murmurhash3js-revisited": "^3.0.0"

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ Multihashing.digest = async (buf, alg, length) => {
5050
*/
5151
Multihashing.createHash = function (alg) {
5252
if (!alg) {
53-
throw errcode('hash algorithm must be specified', 'ERR_HASH_ALGORITHM_NOT_SPECIFIED')
53+
throw errcode(new Error('hash algorithm must be specified'), 'ERR_HASH_ALGORITHM_NOT_SPECIFIED')
5454
}
5555

5656
alg = multihash.coerceCode(alg)
5757
if (!Multihashing.functions[alg]) {
58-
throw errcode(`multihash function '${alg}' not yet supported`, 'ERR_HASH_ALGORITHM_NOT_SUPPORTED')
58+
throw errcode(new Error(`multihash function '${alg}' not yet supported`), 'ERR_HASH_ALGORITHM_NOT_SUPPORTED')
5959
}
6060

6161
return Multihashing.functions[alg]

0 commit comments

Comments
 (0)