@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 a string and, if so, 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)
@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 a string and, if so, 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)