pat310 / quick-pivot

Quickly format data to create a pivot table
https://www.npmjs.com/package/quick-pivot
MIT License
63 stars 21 forks source link

TypeError: Object.values is not a function #59

Closed duanwent closed 7 years ago

duanwent commented 7 years ago

Hi, I'm using this in an application running in node (v6.10.2), was helped by it greatly, but after the change from using babel-polyfill to babel-runtime now I get:

TypeError: Object.values is not a function at o (.../node_modules/quick-pivot/lib/quick-pivot.min.js:1:3952) at i (.../node_modules/quick-pivot/lib/quick-pivot.min.js:1:4228) at s (.../node_modules/quick-pivot/lib/quick-pivot.min.js:1:6506) at new e (.../node_modules/quick-pivot/lib/quick-pivot.min.js:1:1158)

Upgrading to node 7 does fix the problem, is there an easier alternative?

pat310 commented 7 years ago

Ah yea I just noticed this problem today actually. I had removed babel-polyfill because you can only have one babel-polyfill per project. I'm probably using babel-runtime incorrectly - I'll try to figure that out. The alternative will be to just include a polyfill specifically for Object.value.

Since I'm no longer using babel-polyfill, you could now include that in your project which would also correct this problem. Hopefully I'll get this issue corrected soon, thanks for posting

turnerniles commented 7 years ago

@duanwent just curious, what are you using the library for? Also any feedback or suggestions would be helpful!

duanwent commented 7 years ago

Thanks! Requiringbabel-polyfill works perfectly.

@turnerniles I'm using it to pivot some data I get from a mysql query with multiple JOINs then render as CSVs. I tried pivoting in mysql, but writing out combination of 12 months & year by hand is tedious...and doing it through ORM kills performance. actually was sort of a last resort but this indeed helped a lot :)

turnerniles commented 7 years ago

Thanks @duanwent!