File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ export function useNpmSearch(
346346 if ( ( error as NpmSearchError ) ?. data ?. code === 'ERR_TEXT_LENGTH' ) {
347347 try {
348348 const encodedName = encodePackageName ( q )
349- const [ { data : pkg } , { data : downloads } ] = await Promise . all ( [
349+ const [ { data : pkg , isStale } , { data : downloads } ] = await Promise . all ( [
350350 cachedFetch < Packument > ( `${ NPM_REGISTRY } /${ encodedName } ` , { signal } ) ,
351351 cachedFetch < NpmDownloadCount > ( `${ NPM_API } /downloads/point/last-week/${ encodedName } ` , {
352352 signal,
@@ -365,12 +365,7 @@ export function useNpmSearch(
365365 total : 1 ,
366366 }
367367
368- return {
369- objects : [ result ] ,
370- total : 1 ,
371- isStale : false ,
372- time : new Date ( ) . toISOString ( ) ,
373- }
368+ return { ...pkg , isStale }
374369 } catch {
375370 // If exact lookup also fails, throw original error
376371 throw error
You can’t perform that action at this time.
0 commit comments