mirror of
https://github.com/morluto/rea
synced 2026-10-27 14:42:18 -04:00
fix(javascript): share source-map resolution and preserve path uncertainty
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
} from "./javascriptApplicationGraph.js";
|
||||
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
|
||||
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
|
||||
import { resolveJavaScriptSourceMapReferences } from "./javascriptSourceMapPaths.js";
|
||||
|
||||
export const APPLICATION_GRAPH_DIGESTS = {
|
||||
package: "1".repeat(64),
|
||||
@@ -22,6 +23,20 @@ export const completeCoverage = {
|
||||
limits: [],
|
||||
} satisfies ApplicationGraphEvidence["coverage"];
|
||||
|
||||
export const sourceMapReference = (
|
||||
sourceName: string,
|
||||
sourceRoot: string | null,
|
||||
mapPath: string,
|
||||
) => {
|
||||
const reference = resolveJavaScriptSourceMapReferences(
|
||||
[sourceName],
|
||||
sourceRoot,
|
||||
mapPath,
|
||||
)[0];
|
||||
if (reference == null) throw new TypeError("Expected a source-map reference");
|
||||
return reference;
|
||||
};
|
||||
|
||||
const extractor = (operation: string) => ({
|
||||
name: "rea-test-fixture",
|
||||
version: "1.0.0",
|
||||
|
||||
Reference in New Issue
Block a user