Skip to content

Conversation

@ggattoni
Copy link

@ggattoni ggattoni commented Nov 7, 2018

Corrected a bug in input parameter

When calling the function there was no check the number parameter being really a number. This bug fix use an appropriated ad hoc function to check that to reduce improper behaviour and NaN propagation.

Fixed improper input parameter causing NaN wander around code.
Added common base case for performance improvement.
Fixed improper input parameter being negative and causing potential improper behaviour.
Added dependency
Now all tests pass. It should be stated somewhere in the documentation that the function repeat can accept a string as argument "num", it is not not very intuitive, and also can leads to problem if the string does not represent an integer. Now in that case a TypeError is thrown. It can also be passed as argument a negative integer and it does not make any sense actually, so now even in that case a TypeError is thrown. Added check for null and undefined cases, now needed due to the new check on argument num
Now repeat-string module is compatible with node v0.10/0.12
Added fix to missing Number.isInteger method in node v0.10
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.

1 participant