Skip to content

Commit

Permalink
fix: use uuid/v4 to generate unique identifiers. (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored and bcoe committed Jul 5, 2018
1 parent 8ab1ae3 commit 7483ed9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
8 changes: 2 additions & 6 deletions index.js
Expand Up @@ -12,7 +12,6 @@ const Hash = require('./lib/hash')
const libCoverage = require('istanbul-lib-coverage')
const libHook = require('istanbul-lib-hook')
const libReport = require('istanbul-lib-report')
const md5hex = require('md5-hex')
const mkdirp = require('make-dir')
const Module = require('module')
const onExit = require('signal-exit')
Expand All @@ -22,6 +21,7 @@ const resolveFrom = require('resolve-from')
const rimraf = require('rimraf')
const SourceMaps = require('./lib/source-maps')
const testExclude = require('test-exclude')
const uuid = require('uuid/v4')

var ProcessInfo
try {
Expand Down Expand Up @@ -363,11 +363,7 @@ NYC.prototype.wrap = function (bin) {
return this
}

NYC.prototype.generateUniqueID = function () {
return md5hex(
process.hrtime().concat(process.pid).map(String)
)
}
NYC.prototype.generateUniqueID = uuid

NYC.prototype.writeCoverageFile = function () {
var coverage = coverageFinder()
Expand Down
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -89,13 +89,13 @@
"istanbul-lib-source-maps": "^2.0.0",
"istanbul-reports": "^1.5.0",
"make-dir": "^1.3.0",
"md5-hex": "^2.0.0",
"merge-source-map": "^1.1.0",
"resolve-from": "^4.0.0",
"rimraf": "^2.6.2",
"signal-exit": "^3.0.2",
"spawn-wrap": "^1.4.2",
"test-exclude": "^5.0.0",
"uuid": "^3.3.2",
"yargs": "11.1.0",
"yargs-parser": "^9.0.2"
},
Expand Down Expand Up @@ -140,13 +140,13 @@
"istanbul-lib-source-maps",
"istanbul-reports",
"make-dir",
"md5-hex",
"merge-source-map",
"resolve-from",
"rimraf",
"signal-exit",
"spawn-wrap",
"test-exclude",
"uuid",
"yargs",
"yargs-parser"
]
Expand Down

0 comments on commit 7483ed9

Please sign in to comment.