node-sarif-builder
Advanced tools
Comparing version 0.1.2-alpha202201102248.0 to 0.1.2-alpha202201102305.0
{ | ||
"name": "node-sarif-builder", | ||
"version": "0.1.2-alpha202201102248.0", | ||
"version": "0.1.2-alpha202201102305.0", | ||
"description": "Module to help building SARIF log files", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -102,8 +102,8 @@ # node-sarif-builder | ||
if (issue.range) { | ||
sarifResultInit.startLine = incrementOrUndefined(issue.range.start.line); // any integer >= 1 (optional) | ||
sarifResultInit.startColumn = incrementOrUndefined(issue.range.start.character); // any integer >= 1 (optional) | ||
sarifResultInit.endLine = incrementOrUndefined(issue.range.end.line); // any integer >= 1 (optional) | ||
sarifResultInit.endColumn = incrementOrUndefined(issue.range.end.character); // any integer >= 1 (optional) | ||
sarifResultInit.startLine = issue.range.start.line; // any integer >= 1 (optional) | ||
sarifResultInit.startColumn = issue.range.start.character; // any integer >= 1 (optional) | ||
sarifResultInit.endLine = issue.range.end.line; // any integer >= 1 (optional) | ||
sarifResultInit.endColumn = issue.range.end.character; // any integer >= 1 (optional) | ||
} | ||
// Init saarifResultBuilder | ||
// Init sarifResultBuilder | ||
sarifResultBuilder.initSimple(sarifResultInit); | ||
@@ -169,6 +169,6 @@ // Add result to sarifRunBuilder | ||
if (err.range) { | ||
sarifResultInit.startLine = incrementOrUndefined(err.range.start.line); | ||
sarifResultInit.startColumn = incrementOrUndefined(err.range.start.character); | ||
sarifResultInit.endLine = incrementOrUndefined(err.range.end.line); | ||
sarifResultInit.endColumn = incrementOrUndefined(err.range.end.character); | ||
sarifResultInit.startLine = fixLine(err.range.start.line); | ||
sarifResultInit.startColumn = fixCol(err.range.start.character); | ||
sarifResultInit.endLine = fixLine(err.range.end.line); | ||
sarifResultInit.endColumn = fixCol(err.range.end.character); | ||
} | ||
@@ -183,8 +183,15 @@ sarifResultBuilder.initSimple(sarifResultInit); | ||
function incrementOrUndefined(val) { | ||
function fixLine(val) { | ||
if (val === null) { | ||
return undefined; | ||
} | ||
return val + 1; | ||
return val === 0 ? 1 : val; | ||
} | ||
function fixCol(val) { | ||
if (val === null) { | ||
return undefined; | ||
} | ||
return val === 0 ? 1 : val + 1; | ||
} | ||
``` |
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
194
281487