File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,19 +58,6 @@ const pacoteCachePath = getPacoteCachePath()
5858// helper (e.g. `pkgNameToSlug`). Bundlers that stub npm-pack then crash at
5959// module load. A memoized getter defers the cost to the first fetcher use.
6060let _fetcher : ReturnType < typeof makeFetchHappen . defaults > | undefined
61- export function getFetcher ( ) : ReturnType < typeof makeFetchHappen . defaults > {
62- if ( _fetcher === undefined ) {
63- _fetcher = makeFetchHappen . defaults ( {
64- cachePath : pacoteCachePath ,
65- // Prefer-offline: Staleness checks for cached data will be bypassed, but
66- // missing data will be requested from the server.
67- // https://github.com/npm/make-fetch-happen?tab=readme-ov-file#--optscache
68- cache : 'force-cache' ,
69- } )
70- }
71- return _fetcher
72- }
73-
7461/**
7562 * Extract a package to a destination directory.
7663 *
@@ -161,6 +148,19 @@ export function findPackageExtensions(
161148 return result
162149}
163150
151+ export function getFetcher ( ) : ReturnType < typeof makeFetchHappen . defaults > {
152+ if ( _fetcher === undefined ) {
153+ _fetcher = makeFetchHappen . defaults ( {
154+ cachePath : pacoteCachePath ,
155+ // Prefer-offline: Staleness checks for cached data will be bypassed, but
156+ // missing data will be requested from the server.
157+ // https://github.com/npm/make-fetch-happen?tab=readme-ov-file#--optscache
158+ cache : 'force-cache' ,
159+ } )
160+ }
161+ return _fetcher
162+ }
163+
164164/**
165165 * Get the release tag for a version.
166166 *
You can’t perform that action at this time.
0 commit comments