Compare commits

..

No commits in common. "v0.2.0-develop.22" and "v0.2.0-develop.21" have entirely different histories.

4 changed files with 5 additions and 10 deletions

View File

@ -1,5 +1,3 @@
# [0.2.0-develop.22](https://git.lumeweb.com/LumeWeb/libportal/compare/v0.2.0-develop.21...v0.2.0-develop.22) (2023-09-03)
# [0.2.0-develop.21](https://git.lumeweb.com/LumeWeb/libportal/compare/v0.2.0-develop.20...v0.2.0-develop.21) (2023-09-03)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/libportal",
"version": "0.2.0-develop.22",
"version": "0.2.0-develop.21",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/libportal",
"version": "0.2.0-develop.22",
"version": "0.2.0-develop.21",
"dependencies": {
"@lumeweb/libs5": "^0.1.0-develop.44",
"@noble/curves": "^1.1.0",

View File

@ -1,6 +1,6 @@
{
"name": "@lumeweb/libportal",
"version": "0.2.0-develop.22",
"version": "0.2.0-develop.21",
"main": "lib/index.js",
"type": "module",
"repository": {

View File

@ -49,12 +49,9 @@ export function encodeCid(
return base58btc.encode(prefixedHash).toString();
}
export function decodeCid(cid: string | Uint8Array): CID {
let bytes = cid;
export function decodeCid(cid: string): CID {
let bytes = base58btc.decode(cid);
if (typeof bytes === "string") {
bytes = base58btc.decode(bytes);
}
if (!Object.values(CID_TYPES).includes(bytes[0])) {
throw new Error("Invalid cid type");
}