@@ -104,12 +104,10 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions)
104
104
leaf . size = BigInt ( leaf . block . length )
105
105
}
106
106
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
+ } ) )
113
111
114
112
return {
115
113
cid : leaf . cid ,
@@ -128,7 +126,7 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions)
128
126
} )
129
127
130
128
const links : PBLink [ ] = leaves
131
- . filter ( ( leaf ) => {
129
+ . filter ( leaf => {
132
130
if ( leaf . cid . code === rawCodec . code && leaf . size > 0 ) {
133
131
return true
134
132
}
@@ -173,21 +171,16 @@ const reduce = (file: File, blockstore: WritableStorage, options: ReduceOptions)
173
171
const block = encode ( prepare ( node ) )
174
172
const cid = await persist ( block , blockstore , options )
175
173
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
+ } ) )
182
178
183
179
return {
184
180
cid,
185
181
path : file . path ,
186
182
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 ) ) ,
191
184
originalPath : file . originalPath ,
192
185
block
193
186
}
0 commit comments