@@ -104,12 +104,10 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions)
104104 leaf . size = BigInt ( leaf . block . length )
105105 }
106106
107- options . onProgress ?.(
108- new CustomProgressEvent < LayoutLeafProgress > ( 'unixfs:importer:progress:file:layout' , {
109- cid : leaf . cid ,
110- path : leaf . originalPath
111- } )
112- )
107+ options . onProgress ?.( new CustomProgressEvent < LayoutLeafProgress > ( 'unixfs:importer:progress:file:layout' , {
108+ cid : leaf . cid ,
109+ path : leaf . originalPath
110+ } ) )
113111
114112 return {
115113 cid : leaf . cid ,
@@ -128,7 +126,7 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions)
128126 } )
129127
130128 const links : PBLink [ ] = leaves
131- . filter ( ( leaf ) => {
129+ . filter ( leaf => {
132130 if ( leaf . cid . code === rawCodec . code && leaf . size > 0 ) {
133131 return true
134132 }
@@ -173,21 +171,16 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions)
173171 const block = encode ( prepare ( node ) )
174172 const cid = await persist ( block , blockstore , options )
175173
176- options . onProgress ?.(
177- new CustomProgressEvent < LayoutLeafProgress > ( 'unixfs:importer:progress:file:layout' , {
178- cid,
179- path : file . originalPath
180- } )
181- )
174+ options . onProgress ?.( new CustomProgressEvent < LayoutLeafProgress > ( 'unixfs:importer:progress:file:layout' , {
175+ cid,
176+ path : file . originalPath
177+ } ) )
182178
183179 return {
184180 cid,
185181 path : file . path ,
186182 unixfs : f ,
187- size : BigInt (
188- block . length +
189- node . Links . reduce ( ( acc , curr ) => acc + ( curr . Tsize ?? 0 ) , 0 )
190- ) ,
183+ size : BigInt ( block . length + node . Links . reduce ( ( acc , curr ) => acc + ( curr . Tsize ?? 0 ) , 0 ) ) ,
191184 originalPath : file . originalPath ,
192185 block
193186 }
0 commit comments