Skip to content

Conversation

@AkimaLunar
Copy link
Member

@AkimaLunar AkimaLunar commented Mar 10, 2023

image

@brandonthomas
Copy link
Collaborator

is it intentional that the bundle js is checked into the repo?

@AkimaLunar AkimaLunar changed the title Implements the ParseCodeString utilities [NEW in ParesCodeString] Implements the ParseCodeString utilities Mar 15, 2023
@AkimaLunar AkimaLunar changed the title [NEW in ParesCodeString] Implements the ParseCodeString utilities [NEW in ParseCodeString] Implements the ParseCodeString utilities Mar 15, 2023
@AkimaLunar AkimaLunar force-pushed the 85-utility-for-parsing-files-2 branch from 716fd82 to 4994e03 Compare March 15, 2023 23:38
@@ -0,0 +1,6 @@
export const getDependencies = (codeStr: string) => {
const regex = /import\s.*\sfrom\s+['"](.*)['"]/g;
const dependencies = [...codeStr.matchAll(regex)].map(([_, result]) => result);

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings starting with 'import ' and with many repetitions of 'import '.
@AkimaLunar
Copy link
Member Author

is it intentional that the bundle js is checked into the repo?

@brandonthomas, yeah, this is the Arbutus Storybook that I publish. The bundle has to be checked in ATM for GH Pages. GH just released new GH Pages action, that doesn't require the bundle to be checked in, and hosts it on a separate branch instead. But I haven't gotten to swapping that out yet.

@AkimaLunar AkimaLunar added the 🌱 new New package in the library label Mar 16, 2023
@AkimaLunar AkimaLunar changed the title [NEW in ParseCodeString] Implements the ParseCodeString utilities [ParseCodeString] Implements the ParseCodeString utilities Mar 16, 2023
@AkimaLunar AkimaLunar self-assigned this Mar 16, 2023
@AkimaLunar
Copy link
Member Author

This PR needs to be redone with https://github.com/guybedford/es-module-lexer.

@AkimaLunar AkimaLunar added this to the Maintenance milestone May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌱 new New package in the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants