-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String Manipulation Nodes #582
Conversation
Failed to generate code suggestions for PR |
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2') | ||
.replace(/([a-z\d])([A-Z])/g, '$1 $2') | ||
// Replace common delimiters with spaces | ||
.replace(/[-_.]/g, ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get - and _ as they are used for kebab and snake case but I don't think .
should be included tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dot is included to transform from token string to other formats
🦋 Changeset detectedLatest commit: 3abfe5f The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2') | ||
.replace(/([a-z\d])([A-Z])/g, '$1 $2') | ||
// Replace delimiters with spaces using the custom regex | ||
.replace(delimiterRegex, ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is will break as it will only replace the first occurence, so we can rather use replaceAll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add a test to see it works as expected for multiple occurrences
String Manipulation Nodes Enhancement
This PR adds three new string manipulation nodes to enhance text processing capabilities:
New Nodes
1. Case Convert Node
some-mixed_FORMAT test
→someMixedFormatTest
2. Replace Node
hello hello world
with searchhello
and replacehi
→hi hi world
3. Normalize Node
café résumé
→cafe resume