New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tankjs-coverage

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tankjs-coverage - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

24

master.js

@@ -12,6 +12,16 @@ /**

var coverNodeModules = process.env.COVER_NODE_MODULES === 'on';
var coverNodeModules = process.env.cov_all , coverDepth = 0;
if (coverNodeModules) {
if (/^\d+$/.test(coverNodeModules)) {
coverDepth = +coverNodeModules;
coverNodeModules = false;
} else {
coverNodeModules = true;
}
} else {
coverNodeModules = false;
}
// Current coverage information
var files = {}, ignored = {};
var files = {};

@@ -25,4 +35,8 @@ exports.requestHandler = function (req, res) {

Module.prototype._compile = function (content, filename) {
if ((coverNodeModules || filename.indexOf('node_modules') === -1) && !ignored[filename]) {
content = addCoverage(this, filename, content);
var m;
switch (true) {
case coverNodeModules:
case filename.indexOf('node_modules') === -1:
case coverDepth && (m = filename.match(/([\/\\])node_modules\1/g)) && m.length <= coverDepth:
content = addCoverage(this, filename, content);
}

@@ -129,3 +143,3 @@ $_compile.call(this, content, filename);

case 'DoWhileStatement':
console.log(stmt);
// console.log(stmt);
testBlock(stmt.body);

@@ -132,0 +146,0 @@ point = stmt.range[1];

{
"name": "tankjs-coverage",
"version":"0.1.0",
"version": "0.2.0",
"master": "master.js",

@@ -8,7 +8,8 @@ "args": {

"desc": "show code coverage",
"commands": ["start", "restart"]
"commands": ["start", "restart", "test"]
},
"--cov_all": {
"desc": "show code coverage (including code in node_modules)",
"commands": ["start", "restart"],
"demo": "{n}",
"desc": "show code coverage (including code in node_modules). assign a value to specify how many node_modules could a module path contain",
"commands": ["start", "restart", "test"],
"bind_env": "cov_all"

@@ -31,3 +32,5 @@ }

"disable": "tankjs-cluster",
"priority": 100
"priority": 100,
"repository": "https://github.com/Clouda-team/tankjs-coverage.git",
"author": "kyriosli"
}

@@ -26,6 +26,8 @@ (function () {

fileNames = Object.keys(files);
var preLen = fileNames[0].lastIndexOf('/') + 1, pre = fileNames[0].substr(0, preLen);
var preLen = fileNames[0].lastIndexOf('/') + 1 || fileNames[0].lastIndexOf('\\') + 1 , pre = fileNames[0].substr(0, preLen);
fileNames.forEach(function (fileName) {
while (fileName.substr(0, preLen) !== pre) {
pre = pre.substr(0, --preLen);
console.log('trim pre to', pre);
}

@@ -32,0 +34,0 @@ });

Sorry, the diff of this file is not supported yet

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