Closed corsica closed 9 years ago
Please don't bump the version yourself. Also, could you make a test for this?
Just add to one of "other" tests one true and one false boolean somewhere.
I noticed that all parsings to JS of my XML files (with a Schema) using your lib returned only true
for the boolean values, regardless of the boolean value in the XML was true
or false
.
Gladly I could quickly find it in your code and fix it. Tested it and it works. Didn't take the time to fix any tests you might have though.
Here's the change in xsd.js:
BASE_TYPES.boolean = {
parse: function (value) {
- return _.contains(['true', 'false', '0', '1'], value.toLowerCase());
+ return _.contains(['true', '1'], value.toLowerCase());
}
};
As you can see, no matter whether (input-) value
contains 'true', 'false', '0' or '1', it will return true
.
Sorry for my lousy commit messages, didn't sleep that day :-)
Yea, change looks good. Thanks. Could you make this into a full pull request?
Ok, changed the test and cleaned up. The changed test fails with old code, succeeds with the change.
Perfect. Thanks.
Published.
Thanks for the great library, fixed a little bug.