Compare commits

...

3 Commits

4 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,5 @@
# [0.2.0-develop.34](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.33...v0.2.0-develop.34) (2023-09-02)
# [0.2.0-develop.33](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.32...v0.2.0-develop.33) (2023-09-02)
# [0.2.0-develop.32](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.31...v0.2.0-develop.32) (2023-08-20)

4
npm-shrinkwrap.json generated
View File

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

View File

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

View File

@ -7,9 +7,14 @@ import { addContextToErr } from "#err.js";
export function encodeCid(hash: Uint8Array, size: bigint): any;
export function encodeCid(hash: string, size: bigint): any;
export function encodeCid(hash: any, size: bigint): ErrTuple {
export function encodeCid(
hash: any,
size: bigint,
type?: number,
hashType?: number,
): ErrTuple {
try {
return [encodeCidPortal(hash, size), null];
return [encodeCidPortal(hash, size, type, hashType), null];
} catch (e) {
return [null, addContextToErr(e as Error, "failed to encode cid")];
}