alberthaff / ngx-papaparse

Papa Parse wrapper for Angular
https://alberthaff.dk/projects/ngx-papaparse/docs/v8
MIT License
90 stars 19 forks source link

transformHeader #31

Closed median-man closed 5 years ago

median-man commented 5 years ago

Feature Request

I would like to see the transformHeader configuration property supported by this component. This feature is useful for trimming off pesky white space between commas in the header row, in addition to formatting headers in other ways or performing fuzzy matching on them before getting the output back from Papa.

See the PapaParse docs for a complete description of config.transformHeader.

Expected behavior

I would like to provide a function to configuration which accepts the header as an argument and returns a string to be used in place of that header so that I can trim white space, performing matching, etc. with the headers. This function should work precisely as config.transformHeader works in PapaParse.

alberthaff commented 5 years ago

Great idea. I will look into adding this.

However, I have to check, in which version of papaparse this feature was introduced, since i think issue #26 is still a problem.

alberthaff commented 5 years ago

https://github.com/mholt/PapaParse/issues/597#issuecomment-438950257

Unfortunately the function is only available in papaparse@5.0.0-beta.0. I will look into adding it once papaparse@5 is released or maybe release a beta of ngx-papaparse if there is demand.

zhaodong-wang commented 5 years ago

I need this feature too. Is it added in 4.0?

alberthaff commented 5 years ago

It is still only available in the Papa Parse beta. ngx-papaparse 4 will be released when papaparse 5 is ready.

alberthaff commented 5 years ago

Closing this, in favor of #39. A beta of the new version is available.