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

Object checking complete? #1864

Closed
jsumners-nr opened this issue Nov 14, 2023 · 1 comment · Fixed by #1865
Closed

Object checking complete? #1864

jsumners-nr opened this issue Nov 14, 2023 · 1 comment · Fixed by #1865

Comments

@jsumners-nr
Copy link
Contributor

return 'object' === typeof thing && thing !== null

Looking at the current usage of this function, it ultimately goes to:

Object.keys(value).forEach((element) => {

However, [] will pass the isSimpleObject test. I do believe this is a bug. We can improve this by:

return Object.prototype.toString.call(thing) === '[object Object]' && thing !== null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant