@@ -49,7 +49,7 @@ export class Exporter {
49
49
constructor (
50
50
private connection : FirestoreConnectionOptions | Firestore ,
51
51
private writer : IDataSourceWriter ,
52
- private logger : Logger
52
+ private logger : Logger ,
53
53
) { }
54
54
55
55
async run ( options : ExportOptions ) {
@@ -64,7 +64,7 @@ export class Exporter {
64
64
const overwritten = await this . writer . open ( overwrite ) ;
65
65
if ( overwritten )
66
66
this . logger . debug (
67
- `Overwriting existing data at ${ dir ( this . writer . path ) } `
67
+ `Overwriting existing data at ${ dir ( this . writer . path ) } ` ,
68
68
) ;
69
69
70
70
// Get starting paths to explore
@@ -143,7 +143,7 @@ export class Exporter {
143
143
`${ count ( this . exploring ) } exploring` ,
144
144
`${ count ( this . exploreQueue ) } to explore` ,
145
145
`${ count ( this . reads ) } reads` ,
146
- ] . join ( ", " )
146
+ ] . join ( ", " ) ,
147
147
) ;
148
148
}
149
149
@@ -171,7 +171,7 @@ export class Exporter {
171
171
172
172
const [ docPaths , colPaths ] = split ( paths , isDocumentPath ) ;
173
173
const docPathsFiltered = docPaths . filter ( ( path ) =>
174
- typeof depth === "number" ? documentPathDepth ( path ) < depth : true
174
+ typeof depth === "number" ? documentPathDepth ( path ) < depth : true ,
175
175
) ;
176
176
this . exploring . decrement ( docPaths . length - docPathsFiltered . length ) ;
177
177
@@ -183,11 +183,11 @@ export class Exporter {
183
183
184
184
private async exploreForDocuments (
185
185
paths : string [ ] ,
186
- limit ?: number | undefined
186
+ limit ?: number | undefined ,
187
187
) {
188
188
if ( paths . length > 0 )
189
189
this . logger . debug (
190
- `Exploring for documents in ${ plural ( paths , "collection" ) } `
190
+ `Exploring for documents in ${ plural ( paths , "collection" ) } ` ,
191
191
) ;
192
192
193
193
for ( const path of paths ) {
@@ -230,7 +230,7 @@ export class Exporter {
230
230
private async exploreForSubcollections ( paths : string [ ] ) {
231
231
if ( paths . length > 0 )
232
232
this . logger . debug (
233
- `Exploring for subcollections in ${ plural ( paths , "document" ) } `
233
+ `Exploring for subcollections in ${ plural ( paths , "document" ) } ` ,
234
234
) ;
235
235
236
236
if ( this . limitReached ) {
@@ -243,8 +243,8 @@ export class Exporter {
243
243
// The number of paths shouldn't exceed `exploreChunkSize` anyway
244
244
const subcollectionsList = await Promise . all (
245
245
paths . map ( ( path ) =>
246
- ( path ? this . firestore . doc ( path ) : this . firestore ) . listCollections ( )
247
- )
246
+ ( path ? this . firestore . doc ( path ) : this . firestore ) . listCollections ( ) ,
247
+ ) ,
248
248
) ;
249
249
250
250
const subcollections = subcollectionsList . flat ( ) ;
@@ -294,7 +294,7 @@ export class Exporter {
294
294
if ( readyToExport . length >= remaining ) this . limitReached = true ;
295
295
readyToExport = readyToExport . splice ( 0 , remaining ) ;
296
296
this . logger . verbose (
297
- `Exports remaining: ${ count ( remaining ) } / ${ count ( limit ) } `
297
+ `Exports remaining: ${ count ( remaining ) } / ${ count ( limit ) } ` ,
298
298
) ;
299
299
}
300
300
@@ -307,7 +307,7 @@ export class Exporter {
307
307
308
308
const [ paths , snapshots ] = splitStrict (
309
309
readyToExport ,
310
- ( ex ) : ex is string => typeof ex === "string"
310
+ ( ex ) : ex is string => typeof ex === "string" ,
311
311
) ;
312
312
313
313
const refs = paths . map ( ( path ) => this . firestore . doc ( path ) ) ;
@@ -319,7 +319,7 @@ export class Exporter {
319
319
. map ( ( snapshot ) => {
320
320
const document = FirestoreDocument . serialize (
321
321
snapshot . ref . path ,
322
- snapshot . data ( )
322
+ snapshot . data ( ) ,
323
323
) ;
324
324
if ( document ) return JSON . stringify ( document ) ;
325
325
return null ;
@@ -331,7 +331,7 @@ export class Exporter {
331
331
this . exporting . decrement ( readyToExport . length ) ;
332
332
333
333
this . logger . debug (
334
- `Successfully exported ${ plural ( serializedDocuments , "document" ) } `
334
+ `Successfully exported ${ plural ( serializedDocuments , "document" ) } ` ,
335
335
) ;
336
336
}
337
337
}
0 commit comments