node-sarif-builder
Advanced tools
Comparing version 2.0.4-beta202210230106.0 to 2.0.4-beta202210310950.0
{ | ||
"name": "node-sarif-builder", | ||
"version": "2.0.4-beta202210230106.0", | ||
"version": "2.0.4-beta202210310950.0", | ||
"description": "Module to help building SARIF log files", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -113,2 +113,4 @@ # node-sarif-builder | ||
```javascript | ||
import { pathToFileURL } from 'url' | ||
// Add results | ||
@@ -123,4 +125,4 @@ for (const issue of issues) { // issues from your linter in any format | ||
fileUri: process.env.SARIF_URI_ABSOLUTE // Ex: src/myfile.ts | ||
? "file:///" + fileNm.replace(/\\/g, "/") | ||
: path.relative(process.cwd(), fileNm) | ||
? pathToFileURL(fileNm) | ||
: path.relative(process.cwd(), fileNm).replace(/\\/g, '/'), | ||
}; | ||
@@ -157,2 +159,4 @@ // When possible, provide location of the issue in the source code | ||
```javascript | ||
import { pathToFileURL } from 'url' | ||
function buildSarifResult(lintResult) { | ||
@@ -187,4 +191,4 @@ // SARIF builder | ||
fileUri: process.env.SARIF_URI_ABSOLUTE | ||
? "file:///" + fileNm.replace(/\\/g, "/") | ||
: path.relative(process.cwd(), fileNm) | ||
? pathToFileURL(fileNm) | ||
: path.relative(process.cwd(), fileNm).replace(/\\/g, '/') | ||
}; | ||
@@ -191,0 +195,0 @@ if (err.range) { |
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
306831
223