Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Oct 27, 2024
1 parent 7d269f3 commit ba9969f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
39 changes: 22 additions & 17 deletions Source/Function/Output/Transformer/Visit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ import type Interface from "@Interface/Output/Transformer/Visit.js";
export const Fn = ((Usage, Initializer) =>
(...[Context]) =>
(...[Node]) => {
Node = ts.visitEachChild(
Node,
Fn(Usage, Initializer)(Context),
Context,
);
// Node = ;

if (ts.isVariableStatement(Node)) {
// // const declarations = Node.declarationList.declarations.filter(
// // (Declaration) => {
// // return (Usage.get(Declaration.name.getText()) ?? 0) > 1;
// // },
// // );
// // if (declarations.length === 0) {
// // return ts.factory.createEmptyStatement();
// // }
// // return ts.factory.updateVariableStatement(
// // Node,
// // Node.modifiers,
// // ts.factory.updateVariableDeclarationList(
// // Node.declarationList,
// // declarations,
// // ),
// // );
console.log(Node.getText());
}

Expand All @@ -32,20 +44,13 @@ export const Fn = ((Usage, Initializer) =>
);
}
}

// if (NameNode === "nodePath") {
// console.log("----------");
// console.log(NameNode);
// console.log(UsageNode);
// console.log(Node.getFullText());
// console.log(Node.parent.getFullText());
// console.log(ts.isDeclarationStatement(Node));
// console.log(ts.isVariableDeclaration(Node));
// console.log(ts.isVariableStatement(Node));
// }
}

return Node;
return ts.visitEachChild(
Node,
Fn(Usage, Initializer)(Context),
Context,
);
}) satisfies Interface as Interface;

export const { default: ts } = await import("typescript");
Expand Down
2 changes: 1 addition & 1 deletion Target/Function/Output/Transformer/Visit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba9969f

Please sign in to comment.