@c4a/extract 0.7.4 → 0.7.5
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/index.js +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -16386,6 +16386,10 @@ function extractionResultToEvidenceAdapterResult(extraction, invocation) {
|
|
|
16386
16386
|
}
|
|
16387
16387
|
const facts = [];
|
|
16388
16388
|
if (coverageFile.disposition === "analyzed" && fileInfo) {
|
|
16389
|
+
const source = invocation.source_files?.[normalizedPath];
|
|
16390
|
+
if (invocation.source_files !== undefined && source === undefined) {
|
|
16391
|
+
throw new TypeError(`Analyzed file ${normalizedPath} has no scoped source text`);
|
|
16392
|
+
}
|
|
16389
16393
|
facts.push(fact2({
|
|
16390
16394
|
sourceRef: invocation.authorized_scope.source_ref,
|
|
16391
16395
|
moduleRef: invocation.module_ref,
|
|
@@ -16393,7 +16397,11 @@ function extractionResultToEvidenceAdapterResult(extraction, invocation) {
|
|
|
16393
16397
|
qualifiedItemPath: "file",
|
|
16394
16398
|
kind: "source-file",
|
|
16395
16399
|
signature: { path: normalizedPath, language: fileInfo.language },
|
|
16396
|
-
payload: fileInfo
|
|
16400
|
+
payload: source === undefined ? fileInfo : {
|
|
16401
|
+
...fileInfo,
|
|
16402
|
+
line: 1,
|
|
16403
|
+
endLine: source.split(/\r\n|\r|\n/u).length
|
|
16404
|
+
},
|
|
16397
16405
|
denominator: ownsDenominators ? "eligible-file" : "none"
|
|
16398
16406
|
}));
|
|
16399
16407
|
facts.push(fact2({
|