@jsdevtools/coverage-istanbul-loader
Advanced tools
Comparing version 3.0.3 to 3.0.4
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
@@ -32,10 +44,5 @@ }; | ||
schema_utils_1.default(optionsSchema, options, "Coverage Istanbul Loader"); | ||
// If there's no external sourceMap file, then check for an inline sourceMap | ||
if (!sourceMap) { | ||
// Check for an inline source map | ||
const inlineSourceMap = convert.fromSource(source) | ||
|| convert.fromMapFileSource(source, path.dirname(this.resourcePath)); | ||
if (inlineSourceMap) { | ||
// Use the inline source map | ||
sourceMap = inlineSourceMap.sourcemap; | ||
} | ||
sourceMap = getInlineSourceMap.call(this, source); | ||
} | ||
@@ -56,2 +63,26 @@ // Instrument the code | ||
exports.default = default_1; | ||
/** | ||
* If the source code has an inline base64-encoded source map, | ||
* then this function decodes it, parses it, and returns it. | ||
*/ | ||
function getInlineSourceMap(source) { | ||
try { | ||
// Check for an inline source map | ||
const inlineSourceMap = convert.fromSource(source) | ||
|| convert.fromMapFileSource(source, path.dirname(this.resourcePath)); | ||
if (inlineSourceMap) { | ||
// Use the inline source map | ||
return inlineSourceMap.sourcemap; | ||
} | ||
} | ||
catch (e) { | ||
// Exception is thrown by fromMapFileSource when there is no source map file | ||
if (e instanceof Error && e.message.includes("An error occurred while trying to read the map file at")) { | ||
this.emitWarning(e); | ||
} | ||
else { | ||
throw e; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defaultOptions = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * Default Coverage-Istanbul-Loder options. |
{ | ||
"name": "@jsdevtools/coverage-istanbul-loader", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "A Webpack loader that uses Istanbul to add code coverage instrumentation", | ||
@@ -49,28 +49,28 @@ "keywords": [ | ||
"convert-source-map": "^1.7.0", | ||
"istanbul-lib-instrument": "^4.0.1", | ||
"loader-utils": "^1.4.0", | ||
"istanbul-lib-instrument": "^4.0.3", | ||
"loader-utils": "^2.0.0", | ||
"merge-source-map": "^1.1.0", | ||
"schema-utils": "^2.6.4" | ||
"schema-utils": "^2.7.0" | ||
}, | ||
"devDependencies": { | ||
"@jsdevtools/eslint-config-modular": "^8.0.0", | ||
"@jsdevtools/tslint-modular": "^2.0.2", | ||
"@jsdevtools/version-bump-prompt": "^6.0.2", | ||
"@jsdevtools/eslint-config-modular": "^8.0.3", | ||
"@jsdevtools/tslint-modular": "^2.0.5", | ||
"@jsdevtools/version-bump-prompt": "^6.0.3", | ||
"@types/convert-source-map": "^1.5.1", | ||
"@types/istanbul-lib-instrument": "^1.7.3", | ||
"@types/json-schema": "^7.0.4", | ||
"@types/loader-utils": "^1.1.3", | ||
"@types/node": "^13.7.7", | ||
"@types/webpack": "^4.41.7", | ||
"@types/istanbul-lib-instrument": "^1.7.4", | ||
"@types/json-schema": "^7.0.5", | ||
"@types/loader-utils": "^2.0.1", | ||
"@types/node": "^14.0.22", | ||
"@types/webpack": "^4.41.21", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.8.0", | ||
"mocha": "^7.1.0", | ||
"eslint": "^7.4.0", | ||
"mocha": "^8.0.1", | ||
"npm-check": "^5.9.2", | ||
"nyc": "^15.0.0", | ||
"nyc": "^15.1.0", | ||
"shx": "^0.3.2", | ||
"tslint": "^6.0.0", | ||
"typescript": "^3.8.3", | ||
"tslint": "^6.1.2", | ||
"typescript": "^3.9.6", | ||
"typescript-tslint-plugin": "^0.5.5", | ||
"webpack": "^4.42.0" | ||
"webpack": "^4.43.0" | ||
} | ||
} |
Istanbul code coverage loader for Webpack | ||
============================================== | ||
[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/coverage-istanbul-loader/blob/master/.github/workflows/CI-CD.yaml) | ||
[![Build Status](https://github.com/JS-DevTools/coverage-istanbul-loader/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/coverage-istanbul-loader/blob/master/.github/workflows/CI-CD.yaml) | ||
[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/coverage-istanbul-loader/actions) | ||
[![Build Status](https://github.com/JS-DevTools/coverage-istanbul-loader/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/coverage-istanbul-loader/actions) | ||
@@ -42,3 +42,3 @@ [![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/coverage-istanbul-loader/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/coverage-istanbul-loader?branch=master) | ||
-------------------------- | ||
Contributions, enhancements, and bug-fixes are welcome! [File an issue](https://github.com/JS-DevTools/coverage-istanbul-loader/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/coverage-istanbul-loader/pulls). | ||
Contributions, enhancements, and bug-fixes are welcome! [Open an issue](https://github.com/JS-DevTools/coverage-istanbul-loader/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/coverage-istanbul-loader/pulls). | ||
@@ -45,0 +45,0 @@ #### Building/Testing |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16936
154
+ Addedloader-utils@2.0.4(transitive)
- Removedjson5@1.0.2(transitive)
- Removedloader-utils@1.4.2(transitive)
- Removedminimist@1.2.8(transitive)
Updatedloader-utils@^2.0.0
Updatedschema-utils@^2.7.0