Improve code readability
Yes, i know i arrive a bit late, but as we need to work on tests, i though it would be nice to clean the code a bit, and make it use last ES2015 features.
What i mean is for example
- remove almost all array.push
- avoid code duplication
- avoid if indentation hell
The objectives are
- make the code easier to read
- make it easier to mantain
- make it easier to detect bugs
- make it easier to create associated tests
When i will be done with it, i will implement the associated tests on #353 (closed) to avoid future regressions.