charto / cxml

Advanced schema-aware streaming XML parser
MIT License
43 stars 33 forks source link

Boolean values are converted incorrectly #1

Closed giuseppe-santoro closed 8 years ago

giuseppe-santoro commented 8 years ago

All boolean values are converted in true.

The function that convert string 'true' and the string 'false' in boolean is boolean: (function (item) { return !!item; })

This function returns always true values, in fact !!'false' is equal to true.

A safe alternative should be boolean: (function (item) { return item == 'true'; })

jjrv commented 8 years ago

Good point and thank you very much for the PR!

giuseppe-santoro commented 8 years ago

Could you please update the npm package?

Thank you