verimu 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +4 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -128,6 +128,14 @@ interface UsageSnippet {
|
|
|
128
128
|
calledSymbol?: string;
|
|
129
129
|
/** Confidence score in [0, 1] */
|
|
130
130
|
confidence: number;
|
|
131
|
+
/**
|
|
132
|
+
* Which lines within `code` to highlight in the UI.
|
|
133
|
+
* Both values are 0-indexed offsets into the `code` string's lines
|
|
134
|
+
* (i.e. relative to `startLine`, not to the source file).
|
|
135
|
+
* Example: if startLine=6 and the match is on source line 10,
|
|
136
|
+
* highlight = [4, 4] (single-line) or [4, 6] (multi-line range).
|
|
137
|
+
*/
|
|
138
|
+
highlight: [startOffset: number, endOffset: number];
|
|
131
139
|
}
|
|
132
140
|
/** Usage-context outcome for one vulnerability */
|
|
133
141
|
interface UsageContextVulnerabilityFinding {
|
package/dist/index.d.ts
CHANGED
|
@@ -128,6 +128,14 @@ interface UsageSnippet {
|
|
|
128
128
|
calledSymbol?: string;
|
|
129
129
|
/** Confidence score in [0, 1] */
|
|
130
130
|
confidence: number;
|
|
131
|
+
/**
|
|
132
|
+
* Which lines within `code` to highlight in the UI.
|
|
133
|
+
* Both values are 0-indexed offsets into the `code` string's lines
|
|
134
|
+
* (i.e. relative to `startLine`, not to the source file).
|
|
135
|
+
* Example: if startLine=6 and the match is on source line 10,
|
|
136
|
+
* highlight = [4, 4] (single-line) or [4, 6] (multi-line range).
|
|
137
|
+
*/
|
|
138
|
+
highlight: [startOffset: number, endOffset: number];
|
|
131
139
|
}
|
|
132
140
|
/** Usage-context outcome for one vulnerability */
|
|
133
141
|
interface UsageContextVulnerabilityFinding {
|
package/dist/index.mjs
CHANGED
|
@@ -17180,6 +17180,8 @@ function buildSnippet(params) {
|
|
|
17180
17180
|
const startLine = Math.max(1, centerLine - numContextLines);
|
|
17181
17181
|
const endLine = Math.min(lines.length || 1, centerLine + numContextLines);
|
|
17182
17182
|
const code = lines.slice(startLine - 1, endLine).join("\n");
|
|
17183
|
+
const highlightOffset = centerLine - startLine;
|
|
17184
|
+
const highlight = [highlightOffset, highlightOffset];
|
|
17183
17185
|
return {
|
|
17184
17186
|
filePath: relative(projectPath, filePath).split(sep).join("/"),
|
|
17185
17187
|
startLine,
|
|
@@ -17187,7 +17189,8 @@ function buildSnippet(params) {
|
|
|
17187
17189
|
code,
|
|
17188
17190
|
matchKind,
|
|
17189
17191
|
calledSymbol,
|
|
17190
|
-
confidence
|
|
17192
|
+
confidence,
|
|
17193
|
+
highlight
|
|
17191
17194
|
};
|
|
17192
17195
|
}
|
|
17193
17196
|
function dedupeSnippets(snippets) {
|