This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
Refactor getEntityRemovalRange in getCharacterRemovalRange.js #1145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Refactor
getCharacterRemovalRange.js
to get rid of the boolean flag params in the function,getCharacterRemovalRange
. #1116 for more info on the issue. Instead of using boolean flags, I refactored the file to use a type param instead.Although calling two methods was suggested as a solution, I went with another approach because I found it hard to do without putting a bunch of extra control flow statements. I am open to suggestions though.
I think the names of the types can be improved. Forgive me if the names are confusing. Please let me know how they can be improved.
Test Plan
The exported module API is the same and has the exact same functionality, so I don't think more tests need to be added for this branch.