@@ -192,8 +192,8 @@ function findCommonRoot(filepaths) {
192
192
}
193
193
194
194
// assuming / as file separator
195
- const splitParts = filepaths . map ( name => name . split ( '/' ) )
196
- const lengths = splitParts . map ( arr => arr . length )
195
+ const splitParts = filepaths . map ( ( name ) => name . split ( '/' ) )
196
+ const lengths = splitParts . map ( ( arr ) => arr . length )
197
197
const shortestLength = Math . min . apply ( null , lengths )
198
198
debug ( 'shorted file path has %d parts' , shortestLength )
199
199
@@ -205,19 +205,19 @@ function findCommonRoot(filepaths) {
205
205
const part = splitParts [ 0 ] [ k ]
206
206
const prefix = commonPrefix . concat ( part ) . join ( '/' )
207
207
debug ( 'testing prefix %o' , prefix )
208
- const allFilesStart = filepaths . every ( name => name . startsWith ( prefix ) )
208
+ const allFilesStart = filepaths . every ( ( name ) => name . startsWith ( prefix ) )
209
209
if ( ! allFilesStart ) {
210
210
debug ( 'stopped at non-common prefix %s' , prefix )
211
211
break
212
212
}
213
213
214
214
commonPrefix . push ( part )
215
215
216
- const removedPrefixNames = filepaths . map ( filepath =>
216
+ const removedPrefixNames = filepaths . map ( ( filepath ) =>
217
217
filepath . slice ( prefix . length )
218
218
)
219
219
debug ( 'removedPrefix %o' , removedPrefixNames )
220
- const foundAllPaths = removedPrefixNames . every ( filepath =>
220
+ const foundAllPaths = removedPrefixNames . every ( ( filepath ) =>
221
221
existsSync ( join ( cwd , filepath ) )
222
222
)
223
223
debug ( 'all files found at %s? %o' , prefix , foundAllPaths )
@@ -234,7 +234,7 @@ function findCommonRoot(filepaths) {
234
234
function tryFindingLocalFiles ( nycFilename ) {
235
235
const nycCoverage = JSON . parse ( readFileSync ( nycFilename , 'utf8' ) )
236
236
const coverageKeys = Object . keys ( nycCoverage )
237
- const filenames = coverageKeys . map ( key => nycCoverage [ key ] . path )
237
+ const filenames = coverageKeys . map ( ( key ) => nycCoverage [ key ] . path )
238
238
const commonFolder = findCommonRoot ( filenames )
239
239
if ( ! commonFolder ) {
240
240
debug ( 'could not find common folder %s' , commonFolder )
@@ -249,7 +249,7 @@ function tryFindingLocalFiles(nycFilename) {
249
249
const length = commonFolder . length
250
250
let changed
251
251
252
- coverageKeys . forEach ( key => {
252
+ coverageKeys . forEach ( ( key ) => {
253
253
const from = nycCoverage [ key ] . path
254
254
if ( from . startsWith ( commonFolder ) ) {
255
255
const to = join ( cwd , from . slice ( length ) )
@@ -298,13 +298,13 @@ function findSourceFiles(nycOptions) {
298
298
patterns . push ( nycOptions . include )
299
299
} else {
300
300
debug ( 'using default list of extensions' )
301
- nycOptions . extension . forEach ( extension => {
301
+ nycOptions . extension . forEach ( ( extension ) => {
302
302
patterns . push ( '**/*' + extension )
303
303
} )
304
304
}
305
305
306
306
if ( Array . isArray ( nycOptions . exclude ) ) {
307
- const negated = nycOptions . exclude . map ( s => '!' + s )
307
+ const negated = nycOptions . exclude . map ( ( s ) => '!' + s )
308
308
patterns = patterns . concat ( negated )
309
309
} else if ( typeof nycOptions . exclude === 'string' ) {
310
310
patterns . push ( '!' + nycOptions . exclude )
@@ -343,7 +343,7 @@ function includeAllFiles(nycFilename, nycOptions) {
343
343
344
344
const nycCoverage = JSON . parse ( readFileSync ( nycFilename , 'utf8' ) )
345
345
const coverageKeys = Object . keys ( nycCoverage )
346
- const coveredPaths = coverageKeys . map ( key => nycCoverage [ key ] . path )
346
+ const coveredPaths = coverageKeys . map ( ( key ) => nycCoverage [ key ] . path )
347
347
348
348
debug ( 'coverage has %d record(s)' , coveredPaths . length )
349
349
// report on first couple of entries
@@ -353,7 +353,7 @@ function includeAllFiles(nycFilename, nycOptions) {
353
353
}
354
354
355
355
let changed
356
- allFiles . forEach ( fullPath => {
356
+ allFiles . forEach ( ( fullPath ) => {
357
357
if ( coveredPaths . includes ( fullPath ) ) {
358
358
// all good, this file exists in coverage object
359
359
return
0 commit comments