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

Bug with parsing an array of numbers with value 0 #10

Open
xerom opened this issue May 11, 2017 · 2 comments
Open

Bug with parsing an array of numbers with value 0 #10

xerom opened this issue May 11, 2017 · 2 comments

Comments

@xerom
Copy link

xerom commented May 11, 2017

Hi,

There seems to be a bug when parsing 0 values from an array like this from xml: <values><value>1</value><value>0</value><value>2</value></values> which ends up in a json object like:
values: [1, 2]

Hopefully that'd be easy to fix.

@ironchicken
Copy link

This affects version 0.1.1 (which is effectively the current stable version). It's also more general than <xs><x>0</x><x>1</x></xs>. It affects any element with the text content 0. Such elements will be parsed as {_exists: false} in the resulting object.

@ironchicken
Copy link

I have a fork with a fix against the v0.1.1 tag: v0.1.1...ironchicken:bug/parsing-0-text.

But I don't think you can open a pull request against a tag Github, and this bug no longer exists in master.

I think the 0.1.1 branch is important because it's the only one that you can use in any context where you have a plain JavaScript runtime without relying on native code.

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

No branches or pull requests

2 participants