Socket
Socket
Sign inDemoInstall

coffee-coverage

Package Overview
Dependencies
5
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.3 to 0.7.0

docs/development.md

3

CHANGELOG.md
# coffee-coverage Changelog
### v0.7.0
- [#64: Add `postProcessors` option to `register()`](https://github.com/benbria/coffee-coverage/pull/64) and deprecate `streamlinejs` option.
### v0.5.3

@@ -4,0 +7,0 @@ - [#42: Fix the 0% coverage for files that are never loaded](https://github.com/benbria/coffee-coverage/pull/42)

@@ -31,3 +31,3 @@ // Generated by CoffeeScript 1.9.2

module.exports = function(options) {
var compiledCache, coverage, defaults, instrumentFile, instrumentorClass, module, origStreamineCoffeeHandler, replaceHandler, streamlineTransform;
var compiledCache, coverage, defaults, err, instrumentFile, instrumentorClass, module, origStreamineCoffeeHandler, replaceHandler, streamlineTransform;
if (options == null) {

@@ -44,2 +44,3 @@ options = {};

streamlinejs: false,
postProcessors: [],
cachePath: null

@@ -93,3 +94,9 @@ });

if (options.streamlinejs) {
streamlineTransform = require('streamline/lib/callbacks/transform');
console.warn("\noptions.streamlinejs is deprecated. Please use options.postProcessors\n");
try {
streamlineTransform = require('streamline/lib/callbacks/transform');
} catch (_error) {
err = _error;
throw new Error("Could not load streamline transformer < 1.x");
}
origStreamineCoffeeHandler = require.extensions["._coffee"];

@@ -114,5 +121,32 @@ require.extensions["._coffee"] = function(module, fileName) {

}
if (_.isArray(options.postProcessors) && options.postProcessors.length) {
options.postProcessors.forEach(function(processorOpts) {
var ext, fn, originalHandler;
if (processorOpts == null) {
processorOpts = {};
}
ext = processorOpts.ext, fn = processorOpts.fn;
if (!(_.isString(ext) && _.isFunction(fn))) {
return;
} else if ("._coffee" === ext && options.streamlinejs) {
return;
}
originalHandler = require.extensions[ext];
return require.extensions[ext] = function(module, fileName) {
var processed;
if (excludeFile(fileName, options)) {
return originalHandler.call(this, module, fileName);
}
processed = compiledCache.get(fileName, function() {
var compiled;
compiled = instrumentFile(fileName);
return fn(compiled, fileName);
});
return module._compile(processed, fileName);
};
});
}
if (options.writeOnExit) {
return process.on('exit', function() {
var dirName, err, ref1;
var dirName, ref1;
try {

@@ -119,0 +153,0 @@ dirName = path.dirname(options.writeOnExit);

5

package.json

@@ -15,3 +15,3 @@ {

],
"version": "0.6.3",
"version": "0.7.0",
"author": "Benbria (http://www.benbria.com/)",

@@ -56,3 +56,4 @@ "contributors": [

"mocha": "^2.1.0",
"sinon": "^1.14.1"
"sinon": "^1.14.1",
"streamline": "^0.12.1"
},

@@ -59,0 +60,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc