From 95c727ac6ff4dfa56699b456e6411e1eac718f05 Mon Sep 17 00:00:00 2001 From: hexchain Date: Tue, 10 Feb 2026 01:34:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74498=20cacache:?= =?UTF-8?q?=20add=20missing=20options=20argument=20for=20cacache.get.info?= =?UTF-8?q?=20by=20@hexchain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/cacache/cacache-tests.ts | 4 ++++ types/cacache/index.d.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/cacache/cacache-tests.ts b/types/cacache/cacache-tests.ts index d4d60c032015f5..e143b8705748f8 100644 --- a/types/cacache/cacache-tests.ts +++ b/types/cacache/cacache-tests.ts @@ -32,6 +32,10 @@ cacache.get.stream.byDigest(cachePath, "sha512-SoMeDIGest+64==").pipe(fs.createW cacache.get.info(cachePath, "my-thing").then(() => {}); +cacache.get.info(cachePath, "my-thing", { memoize: true }).then(() => {}); + +cacache.get.info(cachePath, "my-thing", { memoize: new Map() }).then(() => {}); + cacache.get.hasContent(cachePath, "sha521-NOT+IN/CACHE==").then((res) => { res; // $ExpectType HasContentObject | false }); diff --git a/types/cacache/index.d.ts b/types/cacache/index.d.ts index c6a54989049b33..e8865f55861b66 100644 --- a/types/cacache/index.d.ts +++ b/types/cacache/index.d.ts @@ -79,6 +79,8 @@ export namespace get { size?: number | undefined; } + type InfoOptions = Pick; + interface GetStreamEvents extends Minipass.Events { // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type integrity: [integrity: string]; @@ -116,7 +118,7 @@ export namespace get { * Looks up `key` in the cache index, returning information about the entry * if one exists. */ - function info(cachePath: string, key: string): Promise; + function info(cachePath: string, key: string, opts?: InfoOptions): Promise; /** * Returns a Readable Stream of the cached data identified by `key`.