Skip to content
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

Merged
merged 3 commits into from
Feb 24, 2023

Conversation

DimensionalDragon
Copy link
Contributor

  • 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

@codecov
Copy link

codecov bot commented Oct 31, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (29835d5) compared to base (a8f30c7).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 29835d5 differs from pull request most recent head 900a362. Consider uploading reports for the commit 900a362 to get more accurate results

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     
Flag Coverage Δ
clojure ?
csharp ?
go ?
rust ?
typescript 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
typescript/src/string/count_chars.ts 100.00% <100.00%> (ø)
typescript/src/string/ltrim.ts 100.00% <100.00%> (ø)
csharp/Pehape/String/Explode.cs
spec/pehape/string/str_repeat_spec.rb
rust/src/string/implode.rs
go/strchr.go
clojure/src/pehape/string/implode.clj
rust/tests/string_test/explode_test.rs
csharp/Pehape/String/Md5.cs
spec/pehape/string/str_rot13_spec.rb
... and 39 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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aldy505 aldy505 requested a review from elianiva October 31, 2022 14:52
}
}

charactersEscaped = charactersEscaped.replace(/([\\^$.|?*+()[\]{}])/g, "\\$1");
Copy link
Contributor

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 :)

Copy link
Contributor Author

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.

@lgtm-com
Copy link

lgtm-com bot commented Oct 31, 2022

This pull request introduces 2 alerts when merging 900a362 into a8f30c7 - view on LGTM.com

new alerts:

  • 2 for Incomplete string escaping or encoding

@aldy505 aldy505 merged commit 09df3cc into teknologi-umum:master Feb 24, 2023
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