mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
fix(javascript): preserve source facts across graph projections
This commit is contained in:
1 parent
dac544be20
commit
c8f8ec656c
14 files changed
+369
-60
No files matched your search
@@ -1,6 +1,18 @@
|
||||
import { z } from "zod";
|
||||
import { digestSchema } from "../digests.js";
|
||||
import type { JavaScriptSourceSelection } from "./javascriptSourceSelection.js";
|
||||
import type { ArtifactOccurrence } from "../artifactGraph.js";
|
||||
|
||||
/** One physical file occurrence, independent of its graph representations. */
|
||||
export const javaScriptFileOccurrenceSchema = z.strictObject({
|
||||
container_sha256: digestSchema,
|
||||
path: z.string().min(1),
|
||||
sha256: digestSchema,
|
||||
});
|
||||
export type JavaScriptFileOccurrence = z.infer<
|
||||
typeof javaScriptFileOccurrenceSchema
|
||||
>;
|
||||
|
||||
/** Whether an inventoried path has a source extension read by the analyzer. */
|
||||
export const isJavaScriptSourcePath = (path: string): boolean =>
|
||||
/\.(?:cjs|cts|mjs|mts|js|jsx|ts|tsx)$/iu.test(path);
|
||||
|
||||
Reference in new issue
Block a user