From b26ebaba838cdc871c12ca52a3e4965fe4ad2d82 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 15 Apr 2024 18:01:32 +0100 Subject: [PATCH] chore: add missing dep --- packages/verified-fetch/package.json | 1 + packages/verified-fetch/src/verified-fetch.ts | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/verified-fetch/package.json b/packages/verified-fetch/package.json index 96001469..22201680 100644 --- a/packages/verified-fetch/package.json +++ b/packages/verified-fetch/package.json @@ -79,6 +79,7 @@ "it-pipe": "^3.0.1", "it-tar": "^6.0.5", "it-to-browser-readablestream": "^2.0.6", + "lru-cache": "^10.2.0", "multiformats": "^13.1.0", "progress-events": "^1.0.0", "uint8arrays": "^5.0.3" diff --git a/packages/verified-fetch/src/verified-fetch.ts b/packages/verified-fetch/src/verified-fetch.ts index 728fdb76..1bfccc83 100644 --- a/packages/verified-fetch/src/verified-fetch.ts +++ b/packages/verified-fetch/src/verified-fetch.ts @@ -46,14 +46,6 @@ interface VerifiedFetchComponents { ipns?: IPNS } -/** - * Potential future options for the VerifiedFetch constructor. - */ -interface VerifiedFetchInit { - contentTypeParser?: ContentTypeParser - dnsResolvers?: DNSResolver[] -} - interface FetchHandlerFunctionArg { cid: CID path: string @@ -149,7 +141,7 @@ export class VerifiedFetch { private readonly contentTypeParser: ContentTypeParser | undefined private readonly blockstoreSessions: LRUCache - constructor ({ helia, ipns }: VerifiedFetchComponents, init?: VerifiedFetchInit) { + constructor ({ helia, ipns }: VerifiedFetchComponents, init?: CreateVerifiedFetchOptions) { this.helia = helia this.log = helia.logger.forComponent('helia:verified-fetch') this.ipns = ipns ?? heliaIpns(helia) @@ -355,7 +347,6 @@ export class VerifiedFetch { let redirected = false const byteRangeContext = new ByteRangeContext(this.helia.logger, options?.headers) const blockstore = this.getBlockstore(cid, cacheKey, session, options) - const fs = unixfs({ blockstore }) try { const pathDetails = await walkPath(blockstore, `${cid.toString()}/${path}`, options)