Socket
Socket
Sign inDemoInstall

istanbul-lib-instrument

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istanbul-lib-instrument - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## [4.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-instrument@4.0.1...istanbul-lib-instrument@4.0.2) (2020-05-06)
### Bug Fixes
* Add ts-ignore to reassignment of generated function ([#557](https://github.com/istanbuljs/istanbuljs/issues/557)) ([817efb0](https://github.com/istanbuljs/istanbuljs/commit/817efb04fc161efae426b2231a0221606b09f559))
* Use @babel/core for all babel imports. ([#555](https://github.com/istanbuljs/istanbuljs/issues/555)) ([a99a13e](https://github.com/istanbuljs/istanbuljs/commit/a99a13ee6931fc124a2a723c3f511cdbcb0aa81d))
## [4.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-instrument@4.0.0...istanbul-lib-instrument@4.0.1) (2020-02-03)

@@ -8,0 +20,0 @@

22

dist/read-coverage.js

@@ -8,6 +8,4 @@ "use strict";

var _parser = require("@babel/parser");
var _core = require("@babel/core");
var _traverse = _interopRequireDefault(require("@babel/traverse"));
var _schema = require("@istanbuljs/schema");

@@ -17,4 +15,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getAst(code) {

@@ -31,8 +27,10 @@ if (typeof code === 'object' && typeof code.type === 'string') {

return (0, _parser.parse)(code, {
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
allowSuperOutsideMethod: true,
sourceType: 'script',
plugins: _schema.defaults.instrumenter.parserPlugins
return (0, _core.parseSync)(code, {
parserOpts: {
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
allowSuperOutsideMethod: true,
sourceType: 'script',
plugins: _schema.defaults.instrumenter.parserPlugins
}
});

@@ -44,3 +42,3 @@ }

let covScope;
(0, _traverse.default)(ast, {
(0, _core.traverse)(ast, {
ObjectProperty(path) {

@@ -47,0 +45,0 @@ const {

@@ -10,3 +10,3 @@ "use strict";

var _template = _interopRequireDefault(require("@babel/template"));
var _core = require("@babel/core");

@@ -19,4 +19,2 @@ var _schema = require("@istanbuljs/schema");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// pattern for istanbul to ignore a section

@@ -535,14 +533,14 @@ const COMMENT_RE = /^\s*istanbul\s+ignore\s+(if|else|next)(?=\W|$)/; // pattern for istanbul to ignore the whole file

};
const globalTemplateAlteredFunction = (0, _template.default)(`
const globalTemplateAlteredFunction = (0, _core.template)(`
var Function = (function(){}).constructor;
var global = (new Function(GLOBAL_COVERAGE_SCOPE))();
`);
const globalTemplateFunction = (0, _template.default)(`
const globalTemplateFunction = (0, _core.template)(`
var global = (new Function(GLOBAL_COVERAGE_SCOPE))();
`);
const globalTemplateVariable = (0, _template.default)(`
const globalTemplateVariable = (0, _core.template)(`
var global = GLOBAL_COVERAGE_SCOPE;
`); // the template to insert at the top of the program.
const coverageTemplate = (0, _template.default)(`
const coverageTemplate = (0, _core.template)(`
function COVERAGE_FUNCTION () {

@@ -560,4 +558,7 @@ var path = PATH;

var actualCoverage = coverage[path];
COVERAGE_FUNCTION = function () {
return actualCoverage;
{
// @ts-ignore
COVERAGE_FUNCTION = function () {
return actualCoverage;
}
}

@@ -567,3 +568,5 @@

}
`); // the rewire plugin (and potentially other babel middleware)
`, {
preserveComments: true
}); // the rewire plugin (and potentially other babel middleware)
// may cause files to be instrumented twice, see:

@@ -570,0 +573,0 @@ // https://github.com/istanbuljs/babel-plugin-istanbul/issues/94

{
"name": "istanbul-lib-instrument",
"version": "4.0.1",
"version": "4.0.2",
"description": "Core istanbul API for JS code coverage",

@@ -17,5 +17,2 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",

"@babel/core": "^7.7.5",
"@babel/parser": "^7.7.5",
"@babel/template": "^7.7.4",
"@babel/traverse": "^7.7.4",
"@istanbuljs/schema": "^0.1.2",

@@ -57,3 +54,3 @@ "istanbul-lib-coverage": "^3.0.0",

},
"gitHead": "4eb43e4325471549d2aa880b5ed2ada475265fcf"
"gitHead": "c4f276e26455dc96705a49e7651e86a2345724ec"
}
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