You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a fix I would suggest using the hasOwnProperty method to avoid iterate over inherited properties, or maybe use Object.keys() and iterate over them to fully avoid for in loop
How to reproduce:
Array.prototype.myFunct=function(){returnthis;}constdata=[1,2,3];newAngularCsv(data,'My Report');// the output will be a CSV file with// 1, 2, 3, function () { return this; }
For moment, as a hack workaround I override the toString() method for prototype functions:
If you add any methods on Array/Object prototype then the
for in
loop fromgetBody()
method will try to export it.https://github.com/alhazmy13/angular-csv-ext/blob/master/Angular-csv.ts#L136
As a fix I would suggest using the
hasOwnProperty
method to avoid iterate over inherited properties, or maybe useObject.keys()
and iterate over them to fully avoid for in loopHow to reproduce:
For moment, as a hack workaround I override the
toString()
method for prototype functions:The text was updated successfully, but these errors were encountered: