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

isPlainObject node 4 vs 6 #2635

Closed
AdriVanHoudt opened this issue Sep 6, 2016 · 5 comments
Closed

isPlainObject node 4 vs 6 #2635

AdriVanHoudt opened this issue Sep 6, 2016 · 5 comments
Labels

Comments

@AdriVanHoudt
Copy link

Hi,

I noticed that using hapijs lodash.isPlainObject(request.query) returns true on node 4 and false on node 6. I know that node 6 changed something (see nodejs/node#6055) but I would suspect it still working.
request.query is being set here https://github.com/hapijs/hapi/blob/master/lib/request.js#L199
I do know request.query is also being validated by Joi so I'm ccing @Marsup to see if he has some insights.

I hope someone knows what's up

@AdriVanHoudt
Copy link
Author

So by debugging I got to

return (typeof Ctor == 'function' &&
stating typeof Ctor == 'function' is false

@AdriVanHoudt
Copy link
Author

Talked to @Marsup and he can't reproduce with Joi so it is probably hapi/node

@jdalton jdalton added the invalid label Sep 6, 2016
@jdalton
Copy link
Member

jdalton commented Sep 6, 2016

Hi @AdriVanHoudt!

If _.isPlainObject is too strict you can also try _.isObject or _.isObjectLike.

@jdalton jdalton closed this as completed Sep 6, 2016
@AdriVanHoudt
Copy link
Author

@jdalton it is not though, I only want a "pure" object no array or function or string

@lock
Copy link

lock bot commented Jan 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants