Objects exported from JS modules are modified by docz, with the addition of a __filemeta property containing an object. This breaks code that expects the object to have a certain shape, e.g. iterating over the entries.
To Reproduce
See the Example.mdx file in https://codesandbox.io/embed/doczbugfilemeta-2u0vr
Expected behavior
Exported objects should not be modified.
Maybe in your case Object.freeze() could work.
I'm not sure why __filemeta is enumerable but if it could be changed to a non enumerable descriptor this issue would be at least narrowed. We mostly iterate over our own defined properties.
Ugh this blew up something for me too
This breaks my forms, where I need to iterate over my form model.
This issue has come-up again with Docz 1.3.2. Every object I enumerate has an extra enumerable __filemeta property, which is breaking things:
@rakannimer Any ideas? I see that #884 might have fixed this, and I haven't see this issue in earlier versions of Docz I was using; not sure why it's suddenly just popped-up.
Most helpful comment
Maybe in your case
Object.freeze()could work.I'm not sure why
__filemetais enumerable but if it could be changed to a non enumerable descriptor this issue would be at least narrowed. We mostly iterate over our own defined properties.