Skip to content

Commit ea94c7f

Browse files
authored
chore: Remove unused functions (#1218)
A couple of sync functions were left behind for a previous version of istanbul-lib-processinfo. These functions are no longer used so they are removed.
1 parent 53c66b9 commit ea94c7f

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

index.js

-22
Original file line numberDiff line numberDiff line change
@@ -501,28 +501,6 @@ class NYC {
501501
)
502502
}
503503

504-
/* istanbul ignore next: legacy function used by istanbul-lib-processinfo. */
505-
eachReport (filenames, iterator, baseDirectory) {
506-
baseDirectory = baseDirectory || this.tempDirectory()
507-
508-
const files = filenames || fs.readdirSync(baseDirectory)
509-
files.forEach(f => {
510-
var report
511-
try {
512-
report = JSON.parse(fs.readFileSync(
513-
path.resolve(baseDirectory, f),
514-
'utf-8'
515-
))
516-
517-
this.sourceMaps.reloadCachedSourceMapsSync(report)
518-
} catch (e) { // handle corrupt JSON output.
519-
report = {}
520-
}
521-
522-
iterator(report)
523-
})
524-
}
525-
526504
tempDirectory () {
527505
return path.resolve(this.cwd, this._tempDirectory)
528506
}

lib/source-maps.js

-21
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,6 @@ class SourceMaps {
7979
{ concurrency: os.cpus().length }
8080
)
8181
}
82-
83-
/* istanbul ignore next: legacy function for istanbul-lib-processinfo */
84-
reloadCachedSourceMapsSync (report) {
85-
Object.entries(report).forEach(([absFile, fileReport]) => {
86-
if (fileReport && fileReport.contentHash) {
87-
const hash = fileReport.contentHash
88-
if (!(hash in this.loadedMaps)) {
89-
try {
90-
const mapPath = this.cachedPath(absFile, hash)
91-
this.loadedMaps[hash] = JSON.parse(fs.readFileSync(mapPath, 'utf8'))
92-
} catch (e) {
93-
// set to false to avoid repeatedly trying to load the map
94-
this.loadedMaps[hash] = false
95-
}
96-
}
97-
if (this.loadedMaps[hash]) {
98-
this._sourceMapCache.registerMap(absFile, this.loadedMaps[hash])
99-
}
100-
}
101-
})
102-
}
10382
}
10483

10584
module.exports = SourceMaps

0 commit comments

Comments
 (0)