You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @classic0, this seems like a v1 bug indeed, the function should either convert the input, or throw. In the meantime, I'd recommend making sure you feed Dinero.js with numbers only (using Number or parseInt on your inputs).
I'm not actively maintaining v1 but I do review PRs, so feel free to check the v1 branch if you want to take a stab at it.
Hello @sarahdayan , I'm trying to fix the bug but I have doubt in allocate function. It should only accepts integer numbers in validation or float number can be accept too? For example, should allocate function accept these arguments?
Is there an existing issue for this?
Current behavior
First off, thanks for the great library.
.allocate() function has unexpected behaviour when given falsy input.
Expected behavior
I expected an error:
TypeError: You must provide a non-empty array of numeric values greater than 0
Steps to reproduce
It never finishes nor throws meanwhile hogging memory.
The same for this:
.allocate([ 1, '98' ])
But this one yields the expected TypeError:
.allocate([ 'a', '98' ])
Version
1.9.1
Environment
14.17.3
Code of Conduct
The text was updated successfully, but these errors were encountered: