@@ -437,10 +437,10 @@ async function sendParallelRequests(urls) {
437437async function fetchWithCacheMultiple ( urls ) {
438438 const url = urls [ 0 ] . split ( "/" ) . slice ( - 2 ) . join ( "/" ) ;
439439
440- console . log ( "reading cache" , url ) ;
440+ console . log ( " reading cache" , url ) ;
441441 const cachedResponse = await localforage . getItem ( url ) ;
442442 if ( cachedResponse ) {
443- console . log ( "reading from cache" , url ) ;
443+ console . log ( " reading from cache" , url ) ;
444444 if ( cachedResponse instanceof Blob ) {
445445 const response = new Response ( cachedResponse ) ;
446446 response . headers . set ( "X-From-Cache" , "true" ) ;
@@ -449,10 +449,10 @@ async function fetchWithCacheMultiple(urls) {
449449 }
450450 const response = new Response ( JSON . parse ( cachedResponse ) ) ;
451451 response . headers . set ( "X-From-Cache" , "true" ) ;
452- console . log ( "Returned cached string " , url ) ;
452+ console . log ( " Returned cached string " , url ) ;
453453 return response ;
454454 }
455- console . log ( "caching " , url ) ;
455+ console . log ( " caching " , url ) ;
456456
457457 // const response = await fetch(url);
458458 const response = await sendParallelRequests ( urls ) ;
@@ -484,22 +484,22 @@ async function fetchWithCache(
484484 url ,
485485 onProgress = ( progress ) => console . log ( `Progress: ${ progress . toFixed ( 2 ) } %` ) ,
486486) {
487- console . log ( "reading cache" , url ) ;
487+ console . log ( " reading cache" , url ) ;
488488 let cachedResponse = await localforage . getItem ( url ) ;
489489 if ( cachedResponse ) {
490- console . log ( "reading from cache" , url ) ;
490+ console . log ( " reading from cache" , url ) ;
491491 if ( cachedResponse instanceof Blob ) {
492492 const response = new Response ( cachedResponse ) ;
493493 response . headers . set ( "X-From-Cache" , "true" ) ;
494- console . log ( "Returned cached blob " , url ) ;
494+ console . log ( " Returned cached blob " , url ) ;
495495 return response ;
496496 }
497497 const response = new Response ( JSON . parse ( cachedResponse ) ) ;
498498 response . headers . set ( "X-From-Cache" , "true" ) ;
499- console . log ( "Returned cached string " , url ) ;
499+ console . log ( " Returned cached string " , url ) ;
500500 return response ;
501501 }
502- console . log ( "caching " , url ) ;
502+ console . log ( " caching " , url ) ;
503503 const response = await fetch ( url ) ;
504504
505505 const contentLength = response . headers . get ( "content-length" ) ;
@@ -540,7 +540,7 @@ async function fetchWithCache(
540540 read ( ) ;
541541 } )
542542 . catch ( ( error ) => {
543- console . error ( "Stream reading error:" , error ) ;
543+ console . error ( " Stream reading error:" , error ) ;
544544 controller . error ( error ) ;
545545 } ) ;
546546 }
@@ -685,11 +685,11 @@ async function translateWithFallback(text, sourceLang = "auto", targetLang) {
685685
686686const translateWithFallbackWrapper = function ( ...args ) {
687687 return translateWithFallback ( ...args )
688- . then ( ( result ) => result )
689- . catch ( ( error ) => {
690- console . error ( "Translation failed:" , error ) ;
691- throw error ;
692- } ) ;
688+ . then ( ( result ) => result )
689+ . catch ( ( error ) => {
690+ console . error ( "Translation failed:" , error ) ;
691+ throw error ;
692+ } ) ;
693693} ;
694694
695695// Now memoize the wrapper function
0 commit comments