Compare commits

...

3 Commits

4 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,5 @@
# [0.2.0-develop.38](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.37...v0.2.0-develop.38) (2023-09-02)
# [0.2.0-develop.37](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.36...v0.2.0-develop.37) (2023-09-02)
# [0.2.0-develop.36](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.35...v0.2.0-develop.36) (2023-09-02)

4
npm-shrinkwrap.json generated
View File

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

View File

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

View File

@ -4,15 +4,16 @@ import {
encodeCid as encodeCidPortal,
} from "@lumeweb/libportal";
import { addContextToErr } from "#err.js";
import type { CID } from "@lumeweb/libportal";
export function encodeCid(hash: Uint8Array, size: bigint): any;
export function encodeCid(hash: string, size: bigint): any;
export function encodeCid(hash: Uint8Array, size: bigint): ErrTuple<string>;
export function encodeCid(hash: string, size: bigint): ErrTuple<string>;
export function encodeCid(
hash: any,
size: bigint,
type?: number,
hashType?: number,
): ErrTuple {
): ErrTuple<CID> {
try {
return [encodeCidPortal(hash, size, type, hashType), null];
} catch (e) {
@ -20,7 +21,7 @@ export function encodeCid(
}
}
export function decodeCid(cid: string): ErrTuple {
export function decodeCid(cid: string): ErrTuple<CID> {
try {
return [decodeCidPortal(cid), null];
} catch (e) {