@@ -107,6 +107,7 @@ export async function clear(
107107 // If no prefix specified, clear everything.
108108 if ( ! opts . prefix ) {
109109 try {
110+ /* c8 ignore next - External cacache call */
110111 await cacache . rm . all ( cacheDir )
111112 return
112113 } catch ( e ) {
@@ -124,11 +125,13 @@ export async function clear(
124125 // For simple prefix (no wildcards), use faster iteration.
125126 if ( ! hasWildcard ) {
126127 let removed = 0
128+ /* c8 ignore next - External cacache call */
127129 const stream = cacache . ls . stream ( cacheDir )
128130
129131 for await ( const entry of stream ) {
130132 if ( entry . key . startsWith ( opts . prefix ) ) {
131133 try {
134+ /* c8 ignore next - External cacache call */
132135 await cacache . rm . entry ( cacheDir , entry . key )
133136 removed ++
134137 } catch {
@@ -142,11 +145,13 @@ export async function clear(
142145
143146 // For wildcard patterns, need to match each entry.
144147 let removed = 0
148+ /* c8 ignore next - External cacache call */
145149 const stream = cacache . ls . stream ( cacheDir )
146150
147151 for await ( const entry of stream ) {
148152 if ( matchesPattern ( entry . key , opts . prefix ) ) {
149153 try {
154+ /* c8 ignore next - External cacache call */
150155 await cacache . rm . entry ( cacheDir , entry . key )
151156 removed ++
152157 } catch {
@@ -173,6 +178,7 @@ export async function get(
173178 )
174179 }
175180 const cacache = getCacache ( ) as any
181+ /* c8 ignore next - External cacache call */
176182 return await cacache . get ( getSocketCacacheDir ( ) , key , options )
177183}
178184
@@ -192,6 +198,7 @@ export async function put(
192198 )
193199 }
194200 const cacache = getCacache ( )
201+ /* c8 ignore next - External cacache call */
195202 return await cacache . put ( getSocketCacacheDir ( ) , key , data , options )
196203}
197204
@@ -207,6 +214,7 @@ export async function remove(key: string): Promise<unknown> {
207214 )
208215 }
209216 const cacache = getCacache ( ) as any
217+ /* c8 ignore next - External cacache call */
210218 return await cacache . rm . entry ( getSocketCacacheDir ( ) , key )
211219}
212220
@@ -233,9 +241,11 @@ export async function withTmp<T>(
233241 const cacache = getCacache ( )
234242 // The DefinitelyTyped types for cacache.tmp.withTmp are incorrect.
235243 // It actually returns the callback's return value, not void.
244+ /* c8 ignore start - External cacache call */
236245 return ( await cacache . tmp . withTmp (
237246 getSocketCacacheDir ( ) ,
238247 { } ,
239248 callback as any ,
240249 ) ) as T
250+ /* c8 ignore stop */
241251}
0 commit comments