Skip to content

Conversation

@ACoderGuy1002
Copy link
Contributor

So, what did I do exactly? Well, the old code was bad / janky because it sent the code we needed to send it through a middle-man file as a .global function. That is not a good idea for multiple reasons. Now, instead of doing that, I made it so that it has its own end-point from its file so that it can be called from where the CSV code is, which actually sends it normally and does not require jank!

@ACoderGuy1002 ACoderGuy1002 self-assigned this Sep 18, 2025
@gcschmit
Copy link
Contributor

In analysis.js, most of the code for the route for transformers.js is identical to the route for processTransformers.js. The only difference is this line:

let output = fs
    .readFileSync(
      `${__dirname}/transformers/${analysisTransformer.template.file}`
    )
    .toString();

where the route for processTransformers.js references the template2 property. All of the code after this is the same. We should decompose all of that code into a function that is called from both routes. This will make it easier to maintain this code in the future.

@ACoderGuy1002
Copy link
Contributor Author

In analysis.js, most of the code for the route for transformers.js is identical to the route for processTransformers.js. The only difference is this line:

let output = fs
    .readFileSync(
      `${__dirname}/transformers/${analysisTransformer.template.file}`
    )
    .toString();

where the route for processTransformers.js references the template2 property. All of the code after this is the same. We should decompose all of that code into a function that is called from both routes. This will make it easier to maintain this code in the future.

I will look into that.

@DhritiKohli DhritiKohli merged commit a57b946 into main Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants