istanbul-lib-instrument
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [3.1.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-instrument@3.1.1...istanbul-lib-instrument@3.1.2) (2019-04-03) | ||
### Bug Fixes | ||
* Be more friendly to ts-node. ([#352](https://github.com/istanbuljs/istanbuljs/issues/352)) ([40d15f5](https://github.com/istanbuljs/istanbuljs/commit/40d15f5)), closes [#336](https://github.com/istanbuljs/istanbuljs/issues/336) | ||
## [3.1.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-instrument@3.1.0...istanbul-lib-instrument@3.1.1) (2019-03-12) | ||
@@ -8,0 +19,0 @@ |
@@ -57,5 +57,4 @@ "use strict"; | ||
const result = {}; | ||
var _arr = ['path', 'hash', 'gcv', 'coverageData']; | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
for (var _i = 0, _arr = ['path', 'hash', 'gcv', 'coverageData']; _i < _arr.length; _i++) { | ||
const key = _arr[_i]; | ||
@@ -62,0 +61,0 @@ const binding = covScope.getOwnBinding(key); |
@@ -525,6 +525,9 @@ "use strict"; | ||
}; | ||
const globalTemplateFunction = (0, _template.default)(` | ||
const globalTemplateAlteredFunction = (0, _template.default)(` | ||
var Function = (function(){}).constructor; | ||
var global = (new Function(GLOBAL_COVERAGE_SCOPE))(); | ||
`); | ||
const globalTemplateFunction = (0, _template.default)(` | ||
var global = (new Function(GLOBAL_COVERAGE_SCOPE))(); | ||
`); | ||
const globalTemplateVariable = (0, _template.default)(` | ||
@@ -545,3 +548,2 @@ var global = GLOBAL_COVERAGE_SCOPE; | ||
} | ||
coverageData.hash = hash; | ||
return coverage[path] = coverageData; | ||
@@ -625,10 +627,18 @@ })(); | ||
const hash = (0, _crypto.createHash)(_constants.SHA).update(JSON.stringify(coverageData)).digest('hex'); | ||
coverageData.hash = hash; | ||
const coverageNode = T.valueToNode(coverageData); | ||
delete coverageData[_constants.MAGIC_KEY]; | ||
delete coverageData.hash; | ||
let gvTemplate; | ||
if (opts.coverageGlobalScopeFunc) { | ||
gvTemplate = globalTemplateFunction({ | ||
GLOBAL_COVERAGE_SCOPE: T.stringLiteral('return ' + opts.coverageGlobalScope) | ||
}); | ||
if (path.scope.getBinding('Function')) { | ||
gvTemplate = globalTemplateAlteredFunction({ | ||
GLOBAL_COVERAGE_SCOPE: T.stringLiteral('return ' + opts.coverageGlobalScope) | ||
}); | ||
} else { | ||
gvTemplate = globalTemplateFunction({ | ||
GLOBAL_COVERAGE_SCOPE: T.stringLiteral('return ' + opts.coverageGlobalScope) | ||
}); | ||
} | ||
} else { | ||
@@ -635,0 +645,0 @@ gvTemplate = globalTemplateVariable({ |
{ | ||
"name": "istanbul-lib-instrument", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Core istanbul API for JS code coverage", | ||
@@ -22,3 +22,3 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", | ||
"istanbul-lib-coverage": "^2.0.4", | ||
"semver": "^5.5.0" | ||
"semver": "^6.0.0" | ||
}, | ||
@@ -43,3 +43,3 @@ "license": "BSD-3-Clause", | ||
}, | ||
"gitHead": "c81b051d83217947dfd97d8d06532bd5013e98c3" | ||
"gitHead": "e8063c799d0854341cb3daaf91c58acd06bd501c" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54008
916
+ Addedsemver@6.3.1(transitive)
- Removedsemver@5.7.2(transitive)
Updatedsemver@^6.0.0