Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Make comment detection RegEx legible #416

Open
baristaGeek opened this issue Dec 15, 2023 · 0 comments
Open

Make comment detection RegEx legible #416

baristaGeek opened this issue Dec 15, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@baristaGeek
Copy link
Collaborator

In detectConsoleLogs.ts we have the consoleLogRegex variable. It's a RegEx literal that will keep growing.

We can do something like the following to keep this RegEx more legible:

const consoleLogsByLanguage = [
   "(console\.log"
   "print"
   // Add the syntax of each language 
]

And then concat this into the RegEx literal. This possibly looks similar to this:

const consoleLogRegex = consoleLogsByLanguage.map(element => element).join('');

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant