-
Notifications
You must be signed in to change notification settings - Fork 6
Add conversion of booleans and a test #3
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clean up the final change by using typeof?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see typeof comment
@@ -48,7 +48,7 @@ ArrayParser.prototype.newEntry = function (includeEmpty) { | |||
if(entry === 'false'){ | |||
entry = false; | |||
} | |||
if (entry !== null && entry !== true && entry !== false) entry = this.transform(entry) | |||
if (entry !== null && typeof(entry) !== 'boolean') entry = this.transform(entry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeof is an opertor, not a function (typeof entry
)
Sorry about that! All this time I've been using it with parens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check Travis, there are a few errors being thrown by standard. After that, LGTM.
Hey, wasn't thinking when I reviewed this. This code doesn't belong here—I'm reverting. That's what the |
This reverts commit 5c9a0d6.
That makes a lot more sense :) Thanks for submitting that! |
Hi,
postgres-array isn't converting boolean arrays correctly. Arrays of type BOOL[] are brought into node as strings.
Thanks!