Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Module._extensions['.coffee'] = Module._extensions['.litcoffee'] = function (module, filename, status) {
var CoffeeScript = require('coffee-script');
var content = CoffeeScript._compileFile(filename, false);
var tmpFuncBody;
var injectFn = exports.getInjectFunctions();
// trim first line when script is a shell script
// content = content.replace(/^\#\![^\n]+\n/, '');
if (status && status.flagjsc) {
content = jscoverage.process(filename, content);
}
if (status && status.needinject) {
tmpFuncBody = injectFunctionBody.toString().replace(/\$\$(\w+)\$\$/g, function (m0, m1) {
return injectFunctions[m1];
});
tmpFuncBody = tmpFuncBody.split(/\n/);
content += '\n' + tmpFuncBody.slice(1, tmpFuncBody.length - 1).join('\n');
}
module._compile(stripBOM(content), filename);
};
require.extensions[".coffee"] = function(module, filename) {
var answer = CoffeeScript._compileFile(filename, false);
var result = babel.transform(answer, {
filename: filename,
sourceMap: "both",
ast: false
});
return module._compile(result.code, filename);
};
}