Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-sarif-builder

Package Overview
Dependencies
Maintainers
1
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sarif-builder - npm Package Compare versions

Comparing version 0.1.2-alpha202201102248.0 to 0.1.2-alpha202201102305.0

2

package.json
{
"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;
}
```
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