v8-to-istanbul
Advanced tools
Comparing version 9.1.3 to 9.2.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [9.2.0](https://github.com/istanbuljs/v8-to-istanbul/compare/v9.1.3...v9.2.0) (2023-11-22) | ||
### Features | ||
* support `/* v8 ignore` ignore hints ([#228](https://github.com/istanbuljs/v8-to-istanbul/issues/228)) ([f8757c0](https://github.com/istanbuljs/v8-to-istanbul/commit/f8757c0c25084a6c60c96a7d9699e67a6e358b14)) | ||
## [9.1.3](https://github.com/istanbuljs/v8-to-istanbul/compare/v9.1.2...v9.1.3) (2023-10-05) | ||
@@ -7,0 +14,0 @@ |
@@ -50,2 +50,3 @@ const CovLine = require('./line') | ||
* c8 ignore stop | ||
* And equivalent ones for v8, e.g. v8 ignore next. | ||
* @param {string} lineStr | ||
@@ -55,3 +56,3 @@ * @return {{count?: number, start?: boolean, stop?: boolean}|undefined} | ||
_parseIgnore (lineStr) { | ||
const testIgnoreNextLines = lineStr.match(/^\W*\/\* c8 ignore next (?<count>[0-9]+)/) | ||
const testIgnoreNextLines = lineStr.match(/^\W*\/\* [c|v]8 ignore next (?<count>[0-9]+)/) | ||
if (testIgnoreNextLines) { | ||
@@ -62,7 +63,7 @@ return { count: Number(testIgnoreNextLines.groups.count) } | ||
// Check if comment is on its own line. | ||
if (lineStr.match(/^\W*\/\* c8 ignore next/)) { | ||
if (lineStr.match(/^\W*\/\* [c|v]8 ignore next/)) { | ||
return { count: 1 } | ||
} | ||
if (lineStr.match(/\/\* c8 ignore next/)) { | ||
if (lineStr.match(/\/\* [c|v]8 ignore next/)) { | ||
// Won't ignore successive lines, but the current line will be ignored. | ||
@@ -72,3 +73,3 @@ return { count: 0 } | ||
const testIgnoreStartStop = lineStr.match(/\/\* c8 ignore (?<mode>start|stop)/) | ||
const testIgnoreStartStop = lineStr.match(/\/\* [c|v]8 ignore (?<mode>start|stop)/) | ||
if (testIgnoreStartStop) { | ||
@@ -75,0 +76,0 @@ if (testIgnoreStartStop.groups.mode === 'start') return { start: true } |
{ | ||
"name": "v8-to-istanbul", | ||
"version": "9.1.3", | ||
"version": "9.2.0", | ||
"description": "convert from v8 coverage format to istanbul's format", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -43,4 +43,6 @@ # v8-to-istanbul | ||
To ignore lines, use the special comment `/* c8 ignore next */`. | ||
To ignore lines, use the special comment `/* v8 ignore next */`. | ||
**NOTE**: Before version `9.2.0` the ignore hint had to contain `c8` keyword, e.g. `/* c8 ignore ...`. | ||
### ignoring the next line | ||
@@ -50,3 +52,3 @@ | ||
const myVariable = 99 | ||
/* c8 ignore next */ | ||
/* v8 ignore next */ | ||
if (process.platform === 'win32') console.info('hello world') | ||
@@ -59,3 +61,3 @@ ``` | ||
const myVariable = 99 | ||
/* c8 ignore next 3 */ | ||
/* v8 ignore next 3 */ | ||
if (process.platform === 'win32') { | ||
@@ -69,7 +71,7 @@ console.info('hello world') | ||
```js | ||
/* c8 ignore start */ | ||
/* v8 ignore start */ | ||
function dontMindMe() { | ||
// ... | ||
} | ||
/* c8 ignore stop */ | ||
/* v8 ignore stop */ | ||
``` | ||
@@ -81,3 +83,3 @@ | ||
const myVariable = 99 | ||
const os = process.platform === 'darwin' ? 'OSXy' /* c8 ignore next */ : 'Windowsy' | ||
const os = process.platform === 'darwin' ? 'OSXy' /* v8 ignore next */ : 'Windowsy' | ||
``` | ||
@@ -84,0 +86,0 @@ |
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
46888
659
89