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
Mappify Map from Object like JSON.stringify #11461
Comments
This comment was originally written by @DuVo Here is my basic implementation. I didn't used it a lot... so many bugs can be still present : dynamic mappify(dynamic object) { void checkCycle(final object) { dynamic mapFromObject(dynamic object) { return mapFromObject(object); |
While this is definitely possible using mirrors, as you have shown, I don't think it's something we will want in the core libraries. Seems like an obvious choice for a package, but not something I think fits in the core library. Removed Type-Defect label. |
This comment was originally written by @DuVo I'm not necessarily talking about adding in the core. And I am aware that a Map can't handle all information from a mirrors. But when I thought about it, it's really like the stringify method, from json. |
Mirrors are no longer supported on the web. For both web and VM our current recommendation is to use codegen. I think there are also a couple VM libraries that do this type of thing with mirrors but it's not something we plan to support in the SDK. |
This issue was originally filed by @DuVo
It should be usefull if we can extract an embedded maps view from an object, like JSON.stringify can do, but with Map.
For example, a num, String, bool, null will return itself.
An objects list or map return a list or a map of mappified object.
The text was updated successfully, but these errors were encountered: