Closed btruhand closed 6 years ago
Thanks for raising the issue.
If I remove the use of Array.from
would that solve the problem?
I never did try... though I personally think it's better off keeping data-forge
code as is. I'd write it down as a bug on collectionsjs
than it is of data-forge
You can either just close this ticket, or put some labels that indicate that this is only some form of warning (or perhaps document it in a wiki)
Ok thanks for logging the issue.
Please be sure to put a star on the repo!
First and foremost, I do not think this is a fault in
data-forge
but I feel like I should raise the issue here so others and author(s) are aware of itI have the following code:
Running the above code will give me the following result
which is what I expected
However if
//const c = require('collections/fast-map');
is uncommented, running it again I will getClearly this is a mistake. After hours of debugging I can at least spot one possible reason for the error. In the build version of
data-forge
withinDataFrame.prototype.toString
function we have the following (cut down for brevity's sake)Doing
console.log(columnNames)
withcollectionsjs
required gives me the following:Without
collectionsjs
I will get the expected result:[ 'Timestamp', 'QPS' ]
Inspecting further the
getColumnNames
function tells me thatArray.from
is used which is overridden bycollectionsjs
implementation: https://github.com/montagejs/collections/blob/master/shim-array.js#L26I managed to fix things on
data-forge
side by doing a seemingly unnecessary function call:This will give me the correct result regardless if
collectionsjs
was used or notThere's an issue raised already in
collectionsjs
regardingArray.from
https://github.com/montagejs/collections/issues/169 and there is also a PR https://github.com/montagejs/collections/pull/173. I'm not sure about the progress of either