Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot d3b8e086ce chore(release): 0.2.0-develop.43 [skip ci]
# [0.2.0-develop.43](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.42...v0.2.0-develop.43) (2023-09-04)

### Bug Fixes

* if we have a Uint8Array but invalid CID_HASH_TYPES, return error ([07a451c](07a451ce5e))
2023-09-04 00:37:19 +00:00
Derrick Hammer f85a2443d3
Merge remote-tracking branch 'origin/develop' into develop 2023-09-03 20:36:18 -04:00
Derrick Hammer 07a451ce5e
fix: if we have a Uint8Array but invalid CID_HASH_TYPES, return error 2023-09-03 20:36:13 -04:00
4 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.2.0-develop.43](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.42...v0.2.0-develop.43) (2023-09-04)
### Bug Fixes
* if we have a Uint8Array but invalid CID_HASH_TYPES, return error ([07a451c](https://git.lumeweb.com/LumeWeb/libweb/commit/07a451ce5ecff302bef201b5f40e916e4420c278))
# [0.2.0-develop.42](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.41...v0.2.0-develop.42) (2023-09-04)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.42",
"version": "0.2.0-develop.43",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.42",
"version": "0.2.0-develop.43",
"dependencies": {
"@lumeweb/community-portals": "^0.1.0-develop.6",
"@lumeweb/libportal": "0.2.0-develop.23",

View File

@ -1,6 +1,6 @@
{
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.42",
"version": "0.2.0-develop.43",
"main": "lib/index.js",
"type": "module",
"repository": {

View File

@ -74,6 +74,12 @@ export function encodeRegistryCid(
hashType = CID_HASH_TYPES.ED25519,
raw: boolean = false,
): ErrTuple<string | Uint8Array> {
if (hash instanceof Uint8Array) {
if (!Object.values(CID_HASH_TYPES).includes(hash[0])) {
return ["", "invalid hash type"];
}
}
return encodeCid(hash, size, type, hashType, raw);
}