Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Refactor getEntityRemovalRange in getCharacterRemovalRange.js #1145

Conversation

jackyho112
Copy link
Contributor

@jackyho112 jackyho112 commented Apr 17, 2017

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.

* get rid of the two boolean flags added in facebookarchive#1108
* rearrange code in a procedural/imperative style to be more understandable
this fixes facebookarchive#1116
@jackyho112 jackyho112 closed this May 30, 2017
@jackyho112 jackyho112 deleted the refactor-get-character-removal-range-module branch May 30, 2017 20:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants