Socket
Socket
Sign inDemoInstall

lcov-result-merger

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lcov-result-merger - npm Package Compare versions

Comparing version 3.3.0 to 4.0.0

13

bin/lcov-result-merger.js
#!/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)
}))

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc