diff --git a/.changeset/old-beers-melt.md b/.changeset/old-beers-melt.md new file mode 100644 index 00000000..9ade9461 --- /dev/null +++ b/.changeset/old-beers-melt.md @@ -0,0 +1,5 @@ +--- +"get-uri": patch +--- + +Close the file descriptor handle when there is a cache hit for `file:` protocol diff --git a/packages/get-uri/src/file.ts b/packages/get-uri/src/file.ts index 0357fd34..cdbf0d1c 100644 --- a/packages/get-uri/src/file.ts +++ b/packages/get-uri/src/file.ts @@ -50,6 +50,7 @@ export const file: GetUriProtocol = async ( // if a `cache` was provided, check if the file has not been modified if (cache && cache.stat && stat && isNotModified(cache.stat, stat)) { + await fdHandle.close(); throw new NotModifiedError(); }