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

Fix parsing of byte strings lacking leading 0 before decimal #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TylerAldrich
Copy link

I noticed the following issue:

> bytes.parse('.25GB');
null
> bytes.parse('0.25GB');
268435456

where if a leading 0 is not supplied, null is always returned. I updated the parse regex to look for 0 or more leading digits so that '.25GB' could be parsed correctly, and added some tests to verify that omitting a leading 0 returns the same result as supplying one.

@TylerAldrich
Copy link
Author

FYI @dougwilson - It looks like when the actions were running there was an issue with downloading https://iojs.org/dist/v2.5.0/iojs-v2.5.0.tar.xz that appears to be fixed (the link itself is working for me now, was erroring 2 days ago).

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.

1 participant