type fix
This commit is contained in:
@@ -14,6 +14,6 @@ export default async function computeCIDs({filePath, algorithms}: {
|
|||||||
filePath: string;
|
filePath: string;
|
||||||
algorithms: CID_ALGORITHM_NAMES[]
|
algorithms: CID_ALGORITHM_NAMES[]
|
||||||
}): Promise<string[]> {
|
}): Promise<string[]> {
|
||||||
const stream = Readable.toWeb(fs.createReadStream(filePath));
|
const stream = Readable.toWeb(fs.createReadStream(filePath)) as ReadableStream<Uint8Array>;
|
||||||
return computeCIDsInternal({stream, algorithms, createHasher});
|
return computeCIDsInternal({stream, algorithms, createHasher});
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ export class HashComputerFile implements ComputeInterface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute only the needed CIDs
|
// Compute only the needed CIDs
|
||||||
const stream = Readable.toWeb(fs.createReadStream(filePath));
|
const stream = Readable.toWeb(fs.createReadStream(filePath)) as ReadableStream<Uint8Array>;
|
||||||
const cids = await computeCIDs({stream, algorithms:neededHashes,createHasher});
|
const cids = await computeCIDs({stream, algorithms:neededHashes,createHasher});
|
||||||
|
|
||||||
// Map the computed CIDs back to their respective metadata properties
|
// Map the computed CIDs back to their respective metadata properties
|
||||||
|
|||||||
Reference in New Issue
Block a user