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

Serializing object containing a ctor function causes crash #215

Closed
utillity opened this issue Jan 15, 2018 · 0 comments · Fixed by #223
Closed

Serializing object containing a ctor function causes crash #215

utillity opened this issue Jan 15, 2018 · 0 comments · Fixed by #223

Comments

@utillity
Copy link

I am trying to serialize a list of objects, which contain the constructor to a sub-object for internal reasons in an attribute _cfgType.

class LensValuedSettingArgs {}
...
FocusPos = new LensValuedSetting({ _cfgType:LensValuedSettingArgs, ... })

this causes a runtime error, as this property cannot be serialized.

TypeError: Cannot read property 'replace' of undefined
  at node_modules/json2csv/lib/json2csv.js:275:50
  at Array.forEach (native)
  at node_modules/json2csv/lib/json2csv.js:215:21
  at Array.forEach (native)
  at createColumnContent (node_modules/json2csv/lib/json2csv.js:209:50)
  at Object.<anonymous>.module.exports (node_modules/json2csv/lib/json2csv.js:60:13)

Since the object hierarchy is deep and complex, I would like to be able to specify ignoreFields instead of fields, or the parser should gracefully ignore attributes containing a function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant