-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
isPlainObject usage blocks objects with prototype #1405
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
Comments
maybe switching to |
doesn't look like it - I don't think there's anything wrong with omitting the prototype check - hey, it works for |
Non-standard use case, but this also prevents plain javascript objects being passed into an iframe from working as well |
Closing as #5151 is a more up-to-date duplicate |
@etpinard @alexcjohnson re: an internal conversation.
The Plotly.js usage of
isPlainObject
appears to prevent objects with a prototype. This doesn't seem to be target behaviour ofisPlainObject
as Plotly.js seems to only care if the object behaves like an object (duck typing). Allowing prototype objects will make it easier for people to integrate Plotly.js with Typescript among other potential use cases.@alexcjohnson made the note that it would be best to change the name of the function.
This issue has been encountered by teams actively integrating Plotly.js with a Typescript application.
The text was updated successfully, but these errors were encountered: