Closed jjsquillante closed 7 years ago
@jjsquillante Thanks and good catch! There's a good number of outstanding PRs and issues for this library, which I'm hoping to get incorporated over the coming month or two. This one seems like a good sensible place to start getting things up-to-date..
@josscrowcroft awesome news!!
Like I said, I've really enjoyed combing through your code for accounting.js so if there's anything else I notice or something I can add (noticed some comments about improving errors from the current state of failing silently), I'll be sure to submit another PR to help out.
hope you enjoy your day/night.
@josscrowcroft Great job on accounting.js. It's been a pleasure reading through the code. Please let me know if I can send some money to buy you a cup of coffee or beer!
As for the pull request: When a string value is passed as the first argument, every character is returned as a value in the array which can cause unwanted results.
According to your comments in the code and the qunit tests, the first argument should only be an array of numbers.
I propose adding a check to detect if the first argument is not an array and, if true, return an empty array. This matches scenarios like if a number, function, or object is passed as the first argument. (all return an empty array)