Skip to content

[ParseCodeString] Implements the ParseCodeString utilities - #87

Open
Aaron Carmin (AkimaLunar) wants to merge 4 commits into
mainfrom
85-utility-for-parsing-files-2
Open

[ParseCodeString] Implements the ParseCodeString utilities#87
Aaron Carmin (AkimaLunar) wants to merge 4 commits into
mainfrom
85-utility-for-parsing-files-2

Conversation

@AkimaLunar

@AkimaLunar Aaron Carmin (AkimaLunar) commented Mar 10, 2023

Copy link
Copy Markdown
Member

image

Comment thread utilities/parse-code-string/src/get-dependencies.tsx Fixed
Comment thread utilities/parse-code-string/src/get-dependencies.tsx Fixed
@brandonthomas

Copy link
Copy Markdown
Collaborator

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

@AkimaLunar Aaron Carmin (AkimaLunar) changed the title Implements the ParseCodeString utilities [NEW in ParesCodeString] Implements the ParseCodeString utilities Mar 15, 2023
@AkimaLunar Aaron Carmin (AkimaLunar) changed the title [NEW in ParesCodeString] Implements the ParseCodeString utilities [NEW in ParseCodeString] Implements the ParseCodeString utilities Mar 15, 2023
@AkimaLunar
Aaron Carmin (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
Copy Markdown
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 Aaron Carmin (AkimaLunar) added the 🌱 new New package in the library label Mar 16, 2023
@AkimaLunar Aaron Carmin (AkimaLunar) changed the title [NEW in ParseCodeString] Implements the ParseCodeString utilities [ParseCodeString] Implements the ParseCodeString utilities Mar 16, 2023
@AkimaLunar

Copy link
Copy Markdown
Member Author

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

@AkimaLunar Aaron Carmin (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