Closed giuseppe-santoro closed 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; })
boolean: (function (item) { return !!item; })
This function returns always true values, in fact !!'false' is equal to true.
!!'false'
A safe alternative should be boolean: (function (item) { return item == 'true'; })
boolean: (function (item) { return item == 'true'; })
Good point and thank you very much for the PR!
Could you please update the npm package?
Thank you
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'; })