Skip to content

Commit d3276fa

Browse files
committed
fix(diff): remove dead move variant and guard AST parse by file type
1 parent e41095f commit d3276fa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/core/structural-diff.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function parseSource(code: string, fileName: string) {
1010
* This can be expanded to include specific AST node types.
1111
*/
1212
export interface StructuralChange {
13-
type: "addition" | "deletion" | "modification" | "move";
13+
type: "addition" | "deletion" | "modification";
1414
nodeName?: string;
1515
startLine: number;
1616
endLine: number;
@@ -22,6 +22,10 @@ export function compareStructural(
2222
after: string,
2323
fileName: string,
2424
): StructuralChange[] {
25+
if (!/\.(tsx?|jsx?)$/i.test(fileName)) {
26+
return [];
27+
}
28+
2529
const beforeSource = parseSource(before, fileName);
2630
const afterSource = parseSource(after, fileName);
2731

0 commit comments

Comments
 (0)