From a22145caec491807a111c525cd9929ae23bbc95f Mon Sep 17 00:00:00 2001 From: Tyler <26290074+tylersayshi@users.noreply.github.com> Date: Sat, 9 Aug 2025 14:00:00 -0700 Subject: [PATCH] remove llm junk --- debug_union.ts | 47 ------------------- sample.ts | 112 ---------------------------------------------- sample_backup.ts | 112 ---------------------------------------------- test_edge_case.ts | 6 --- test_script.ts | 3 -- 5 files changed, 280 deletions(-) delete mode 100644 debug_union.ts delete mode 100644 sample.ts delete mode 100644 sample_backup.ts delete mode 100644 test_edge_case.ts delete mode 100644 test_script.ts diff --git a/debug_union.ts b/debug_union.ts deleted file mode 100644 index a9d61fe..0000000 --- a/debug_union.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Project, SyntaxKind } from "ts-morph"; - -const project = new Project(); -const sourceFile = project.addSourceFileAtPath("sample_backup.ts"); - -// Find all union types -const unionTypes = sourceFile.getDescendantsOfKind(SyntaxKind.UnionType); - -console.log(`Found ${unionTypes.length} union types`); - -unionTypes.forEach((unionType, index) => { - console.log(`\nUnion type ${index + 1}:`); - console.log(`Text: ${unionType.getText()}`); - - const types = unionType.getTypeNodes(); - console.log(`Number of type nodes: ${types.length}`); - - types.forEach((typeNode, typeIndex) => { - console.log(` Type ${typeIndex + 1}:`); - console.log(` Kind: ${typeNode.getKind()}`); - console.log(` Text: ${typeNode.getText()}`); - - if (typeNode.getKind() === SyntaxKind.PropertyAccessExpression) { - console.log(` Is PropertyAccessExpression: true`); - const propAccess = typeNode as any; - const expression = propAccess.getExpression(); - console.log(` Expression kind: ${expression.getKind()}`); - console.log(` Expression text: ${expression.getText()}`); - console.log(` Property name: ${propAccess.getNameNode().getText()}`); - } - }); -}); - -// Also check for type aliases that might contain union types -const typeAliases = sourceFile.getTypeAliases(); -console.log(`\nFound ${typeAliases.length} type aliases`); - -typeAliases.forEach((typeAlias, index) => { - console.log(`\nType alias ${index + 1}: ${typeAlias.getName()}`); - console.log(`Text: ${typeAlias.getText()}`); - - const typeNode = typeAlias.getTypeNode(); - if (typeNode) { - console.log(`Type node kind: ${typeNode.getKind()}`); - console.log(`Type node text: ${typeNode.getText()}`); - } -}); diff --git a/sample.ts b/sample.ts deleted file mode 100644 index 95cd03f..0000000 --- a/sample.ts +++ /dev/null @@ -1,112 +0,0 @@ -enum Color { - Red = "red", - Green = "green", - Blue = "blue", -} - -enum Status { - Pending = 0, - Active = 1, - Inactive = 2, -} - -enum Direction { - North = "NORTH", - South = "SOUTH", - East = "EAST", - West = "WEST", -} - -enum Priority { - Low = 0, - Medium = 1, - High = 2, - Critical = "CRITICAL", -} - -function _getColorName(color: Color): string { - return color; -} - -function _getStatusText(status: Status): string { - switch (status) { - case Status.Pending: - return "Pending"; - case Status.Active: - return "Active"; - case Status.Inactive: - return "Inactive"; - default: - return "Unknown"; - } -} - -interface User { - id: number; - name: string; - status: Status; - favoriteColor: Color; -} - -class Navigation { - private currentDirection: Direction = Direction.North; - - turnLeft(): void { - switch (this.currentDirection) { - case Direction.North: - this.currentDirection = Direction.West; - break; - case Direction.West: - this.currentDirection = Direction.South; - break; - case Direction.South: - this.currentDirection = Direction.East; - break; - case Direction.East: - this.currentDirection = Direction.North; - break; - } - } - - getDirection(): Direction { - return this.currentDirection; - } -} - -type TaskPriority = Priority.Low | Priority.Medium | Priority.High; - -function processTask(priority: TaskPriority): void { - console.log(`Processing task with priority: ${priority}`); -} - -function _handleLowPriority(p: Priority.Low): void { - console.log(`Handling low priority task: ${p}`); -} - -const _allColors: Color[] = [Color.Red, Color.Green, Color.Blue]; - -const _colorMap: Record = { - [Color.Red]: "#FF0000", - [Color.Green]: "#00FF00", - [Color.Blue]: "#0000FF", -}; - -function _createEnumArray(enumObj: Record): T[] { - return Object.values(enumObj); -} - -const _user: User = { - id: 1, - name: "John", - status: Status.Active, - favoriteColor: Color.Blue, -}; - -const navigation = new Navigation(); -navigation.turnLeft(); -console.log(navigation.getDirection()); - -processTask(Priority.High); - -export { Color, Status, Direction, Priority }; -export type { User, TaskPriority }; diff --git a/sample_backup.ts b/sample_backup.ts deleted file mode 100644 index 95cd03f..0000000 --- a/sample_backup.ts +++ /dev/null @@ -1,112 +0,0 @@ -enum Color { - Red = "red", - Green = "green", - Blue = "blue", -} - -enum Status { - Pending = 0, - Active = 1, - Inactive = 2, -} - -enum Direction { - North = "NORTH", - South = "SOUTH", - East = "EAST", - West = "WEST", -} - -enum Priority { - Low = 0, - Medium = 1, - High = 2, - Critical = "CRITICAL", -} - -function _getColorName(color: Color): string { - return color; -} - -function _getStatusText(status: Status): string { - switch (status) { - case Status.Pending: - return "Pending"; - case Status.Active: - return "Active"; - case Status.Inactive: - return "Inactive"; - default: - return "Unknown"; - } -} - -interface User { - id: number; - name: string; - status: Status; - favoriteColor: Color; -} - -class Navigation { - private currentDirection: Direction = Direction.North; - - turnLeft(): void { - switch (this.currentDirection) { - case Direction.North: - this.currentDirection = Direction.West; - break; - case Direction.West: - this.currentDirection = Direction.South; - break; - case Direction.South: - this.currentDirection = Direction.East; - break; - case Direction.East: - this.currentDirection = Direction.North; - break; - } - } - - getDirection(): Direction { - return this.currentDirection; - } -} - -type TaskPriority = Priority.Low | Priority.Medium | Priority.High; - -function processTask(priority: TaskPriority): void { - console.log(`Processing task with priority: ${priority}`); -} - -function _handleLowPriority(p: Priority.Low): void { - console.log(`Handling low priority task: ${p}`); -} - -const _allColors: Color[] = [Color.Red, Color.Green, Color.Blue]; - -const _colorMap: Record = { - [Color.Red]: "#FF0000", - [Color.Green]: "#00FF00", - [Color.Blue]: "#0000FF", -}; - -function _createEnumArray(enumObj: Record): T[] { - return Object.values(enumObj); -} - -const _user: User = { - id: 1, - name: "John", - status: Status.Active, - favoriteColor: Color.Blue, -}; - -const navigation = new Navigation(); -navigation.turnLeft(); -console.log(navigation.getDirection()); - -processTask(Priority.High); - -export { Color, Status, Direction, Priority }; -export type { User, TaskPriority }; diff --git a/test_edge_case.ts b/test_edge_case.ts deleted file mode 100644 index e1bee06..0000000 --- a/test_edge_case.ts +++ /dev/null @@ -1,6 +0,0 @@ -const StringEnum = { - X: "x", - Y: "y" -} as const; - -type StringEnum = typeof StringEnum[keyof typeof StringEnum]; diff --git a/test_script.ts b/test_script.ts deleted file mode 100644 index 2fb3728..0000000 --- a/test_script.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { runCodemod } from "./main.ts"; - -runCodemod("test_edge_case.ts"); -- 2.51.2