Compare commits
No commits in common. "v0.2.0-develop.46" and "v0.2.0-develop.45" have entirely different histories.
v0.2.0-dev
...
v0.2.0-dev
|
@ -1,10 +1,3 @@
|
||||||
# [0.2.0-develop.46](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.45...v0.2.0-develop.46) (2023-09-04)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* if has is a CID, override arguments with the CID properties unless we have an argument set already ([2c56658](https://git.lumeweb.com/LumeWeb/libweb/commit/2c56658a6c06c51e6f079232c35cce05a6ca72c3))
|
|
||||||
|
|
||||||
# [0.2.0-develop.45](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.44...v0.2.0-develop.45) (2023-09-04)
|
# [0.2.0-develop.45](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.44...v0.2.0-develop.45) (2023-09-04)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libweb",
|
"name": "@lumeweb/libweb",
|
||||||
"version": "0.2.0-develop.46",
|
"version": "0.2.0-develop.45",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/libweb",
|
"name": "@lumeweb/libweb",
|
||||||
"version": "0.2.0-develop.46",
|
"version": "0.2.0-develop.45",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
||||||
"@lumeweb/libportal": "0.2.0-develop.23",
|
"@lumeweb/libportal": "0.2.0-develop.23",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libweb",
|
"name": "@lumeweb/libweb",
|
||||||
"version": "0.2.0-develop.46",
|
"version": "0.2.0-develop.45",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
15
src/cid.ts
15
src/cid.ts
|
@ -22,26 +22,13 @@ export function encodeCid(
|
||||||
hashType?: number,
|
hashType?: number,
|
||||||
raw?: boolean,
|
raw?: boolean,
|
||||||
): ErrTuple<string | Uint8Array>;
|
): ErrTuple<string | Uint8Array>;
|
||||||
export function encodeCid(
|
|
||||||
hash: CID,
|
|
||||||
size?: bigint,
|
|
||||||
type?: number,
|
|
||||||
hashType?: number,
|
|
||||||
raw?: boolean,
|
|
||||||
): ErrTuple<string | Uint8Array>;
|
|
||||||
export function encodeCid(
|
export function encodeCid(
|
||||||
hash: any,
|
hash: any,
|
||||||
size?: bigint,
|
size: bigint,
|
||||||
type?: number,
|
type?: number,
|
||||||
hashType?: number,
|
hashType?: number,
|
||||||
raw: boolean = false,
|
raw: boolean = false,
|
||||||
): ErrTuple<string | Uint8Array> {
|
): ErrTuple<string | Uint8Array> {
|
||||||
if (typeof hash !== "string" && !(hash instanceof Uint8Array)) {
|
|
||||||
size = hash.size;
|
|
||||||
type = type ?? hash.type;
|
|
||||||
hashType = hashType ?? hash.type;
|
|
||||||
hash = hash.hash;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
return [encodeCidPortal(hash, size, type, hashType, raw), null];
|
return [encodeCidPortal(hash, size, type, hashType, raw), null];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue