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

Improper argument bug correction #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant