Skip to content

Comments

feat: add Typescript function regex support#563

Open
a2937 wants to merge 6 commits intofreeCodeCamp:mainfrom
a2937:feat/add-typescript-support
Open

feat: add Typescript function regex support#563
a2937 wants to merge 6 commits intofreeCodeCamp:mainfrom
a2937:feat/add-typescript-support

Conversation

@a2937
Copy link
Member

@a2937 a2937 commented Feb 5, 2026

Checklist:

Closes #XXXXX

This adds support to the Function regex in order to handle functions like

function myFunc(arg1 : string, arg2 : string) : string{
}

which won't match under the current set of helpers. Additionally there are no breaking changes if the tests are to be believed.

@a2937 a2937 requested a review from a team as a code owner February 5, 2026 21:26
Copy link
Contributor

@majestic-owl448 majestic-owl448 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between . and [\w\W]?

@a2937
Copy link
Member Author

a2937 commented Feb 7, 2026

I panicked. They're probably identical. I could probably have used only the one regex symbol rather than both.

@a2937
Copy link
Member Author

a2937 commented Feb 8, 2026

Okay I tried something a little less extreme and added tests for the other regex. How's it look?

Copy link
Contributor

@majestic-owl448 majestic-owl448 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you try instead adding the pattern for types? adding something that can match anything seems dangerous

@a2937
Copy link
Member Author

a2937 commented Feb 9, 2026

Please tell me this is close to what you meant. My goal was to make it so that way there's a function specifically there for Typescript Types. And it could be modified such that specific types can be added as a parameter.

@Dario-DC
Copy link
Contributor

Dario-DC commented Feb 9, 2026

We are thinking of adding AST-based helpers for TypeScript as well. So this might not be necessary. I'll keep you posted.

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.

3 participants