Fix Parse.byteCount in the case of unknown units
Parse.byteCount
is supposed to parse numbers followed by an optional units suffix, like "1500"
or "1.5M"
. It behaves incorrectly in the case of an unrecognized suffix ("1.5X"
), returning NaN
instead of null
.
The first part of the patch adds tests for Parse.byteCount
and Params.getByteCount
, which fail:
1) Parse byte count returns null for bad inputs
Message:
Expected NaN to be null.
Stack:
Error: Expected NaN to be null.
at Object.<anonymous> (snowflake/proxy/test/bundle.spec.js:1849:37)
...
The second part of the patch fixes Parse.byteCount
so it doesn't fail.