lcov-result-merger
Advanced tools
Comparing version 3.3.0 to 4.0.0
#!/usr/bin/env node | ||
const vfs = require('vinyl-fs') | ||
var fg = require('fast-glob'); | ||
const through = require('through2') | ||
@@ -38,10 +38,13 @@ const fs = require('fs') | ||
vfs.src(args.pattern) | ||
fg.stream(args.pattern, { absolute: true }) | ||
.pipe(lcovResultMerger(args)) | ||
.pipe(through.obj((file) => { | ||
.pipe(through.obj((filePath) => { | ||
const file = fs.openSync(filePath, "r+") | ||
const fileContentStr = fs.readFileSync(file, "utf8") | ||
if (args.outFile) { | ||
fs.writeFileSync(args.outFile, file.contents) | ||
fs.writeFileSync(args.outFile, fileContentStr) | ||
} else { | ||
process.stdout.write(file.contents) | ||
process.stdout.write(fileContentStr) | ||
} | ||
fs.closeSync(file) | ||
})) |
33
index.js
@@ -10,3 +10,3 @@ /** | ||
var through = require('through2') | ||
var File = require('vinyl') | ||
var fs = require('fs') | ||
var path = require('path') | ||
@@ -333,5 +333,10 @@ | ||
function createRecords (coverageFiles) { | ||
return coverageFiles.map(function (coverageFile) { | ||
return coverageFile.toString() | ||
}).join('') | ||
return coverageFiles | ||
.sort(function (fileA, fileB) { | ||
return fileA.filename.localeCompare(fileB.filename) | ||
}) | ||
.map(function (coverageFile) { | ||
return coverageFile.toString() | ||
}) | ||
.join('') | ||
} | ||
@@ -341,20 +346,18 @@ | ||
var coverageFiles = [] | ||
return through.obj(function process (file, encoding, callback) { | ||
if (file.isNull()) { | ||
return through.obj(function (filePath, encoding, callback) { | ||
if (!fs.existsSync(filePath)) { | ||
callback() | ||
return | ||
} | ||
if (file.isStream()) { | ||
throw new Error('Streaming not supported') | ||
} | ||
coverageFiles = processFile(file.dirname, file.contents.toString(), coverageFiles, config || {}) | ||
var file = fs.openSync(filePath, "r") | ||
var fileContentStr = fs.readFileSync(file, "utf8") | ||
coverageFiles = processFile(path.dirname(filePath), fileContentStr, coverageFiles, config || {}) | ||
fs.closeSync(file) | ||
callback() | ||
}, function flush () { | ||
var file = new File({ | ||
path: 'lcov.info', | ||
contents: Buffer.from(createRecords(coverageFiles)) | ||
}) | ||
this.push(file) | ||
var file = fs.openSync("lcov.info", "w+") | ||
fs.writeFileSync(file, Buffer.from(createRecords(coverageFiles))) | ||
this.push("lcov.info") | ||
this.emit('end') | ||
}) | ||
} |
@@ -41,5 +41,4 @@ { | ||
"dependencies": { | ||
"fast-glob": "^3.2.11", | ||
"through2": "^2.0.3", | ||
"vinyl": "^2.1.0", | ||
"vinyl-fs": "^3.0.2", | ||
"yargs": "^16.2.0" | ||
@@ -50,6 +49,5 @@ }, | ||
"chai": "^4.1.2", | ||
"chai-gulp-helpers": "0.0.3", | ||
"coveralls": "^3.0.0", | ||
"cz-conventional-changelog": "^3.2.0", | ||
"eslint": "^4.18.2", | ||
"cz-conventional-changelog": "^3.0.1", | ||
"eslint": "^5.16.0", | ||
"eslint-config-standard": "^11.0.0", | ||
@@ -60,10 +58,10 @@ "eslint-plugin-promise": "^4.2.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^8.0.1", | ||
"mocha": "^10.0.0", | ||
"rimraf": "^2.6.3", | ||
"semantic-release": "^17.1.1", | ||
"standard": "^11.0.0", | ||
"travis-deploy-once": "^5.0.0" | ||
"semantic-release": "^19.0.3", | ||
"standard": "^17.0.0", | ||
"travis-deploy-once": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=14" | ||
}, | ||
@@ -75,3 +73,3 @@ "config": { | ||
}, | ||
"version": "3.3.0", | ||
"version": "4.0.0", | ||
"volta": { | ||
@@ -78,0 +76,0 @@ "node": "10.23.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15481
3
15
369
2
+ Addedfast-glob@^3.2.11
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedvinyl@^2.1.0
- Removedvinyl-fs@^3.0.2
- Removedappend-buffer@1.0.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbuffer-equal@1.0.1(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedclone@2.1.2(transitive)
- Removedclone-buffer@1.0.0(transitive)
- Removedclone-stats@1.0.0(transitive)
- Removedcloneable-readable@1.1.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedduplexify@3.7.1(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedextend@3.0.2(transitive)
- Removedflush-write-stream@1.1.1(transitive)
- Removedfs-mkdirp-stream@1.0.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@3.1.0(transitive)
- Removedglob-stream@6.1.0(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-absolute@1.0.0(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-glob@3.1.0(transitive)
- Removedis-negated-glob@1.0.0(transitive)
- Removedis-relative@1.0.0(transitive)
- Removedis-unc-path@1.0.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedis-valid-glob@1.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedjson-stable-stringify-without-jsonify@1.0.1(transitive)
- Removedlazystream@1.0.1(transitive)
- Removedlead@1.0.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removednow-and-later@2.0.1(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedonce@1.4.0(transitive)
- Removedordered-read-streams@1.0.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpump@2.0.1(transitive)
- Removedpumpify@1.5.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedremove-bom-buffer@3.0.0(transitive)
- Removedremove-bom-stream@1.2.0(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedreplace-ext@1.0.1(transitive)
- Removedresolve-options@1.1.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedstream-shift@1.0.3(transitive)
- Removedthrough2@4.0.2(transitive)
- Removedthrough2-filter@3.1.0(transitive)
- Removedto-absolute-glob@2.0.2(transitive)
- Removedto-through@2.0.0(transitive)
- Removedunc-path-regex@0.1.2(transitive)
- Removedunique-stream@2.3.1(transitive)
- Removedvalue-or-function@3.0.0(transitive)
- Removedvinyl@2.2.1(transitive)
- Removedvinyl-fs@3.0.3(transitive)
- Removedvinyl-sourcemap@1.1.0(transitive)
- Removedwrappy@1.0.2(transitive)