-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(TypeScript): ltrim #71
feat(TypeScript): ltrim #71
Conversation
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #71 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 55 9 -46
Lines 732 72 -660
Branches 20 23 +3
==========================================
- Hits 732 72 -660
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
typescript/src/string/ltrim.ts
Outdated
} | ||
} | ||
|
||
charactersEscaped = charactersEscaped.replace(/([\\^$.|?*+()[\]{}])/g, "\\$1"); |
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.
Btw, in character class you only need to escape backslashes and closing brackets
const charactersEscaped = characters.replace('\\', '\\\\').replace(']', '\\]')
easier to read too :)
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.
Oh, right. I forgot to change that, I originally used the (a|b|c) implementation where every special characters must be escaped, but I forgot to change it when I change the implementation to [abc]. Thanks for reminding me.
…racter range parameter
This pull request introduces 2 alerts when merging 900a362 into a8f30c7 - view on LGTM.com new alerts:
|
Programming langugage: TypeScript
Function(s) that I'm implementing: ltrim
Issue number: Typescript Implementation #18
I have created unit tests to support my implementation
I have created in-code documentation (or docstring) to document my code
(Optional) I have updated the README.md file to document the function I'm implementing