alberthaff / ngx-papaparse

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

Config interface for unparse method should different from config for parse method #17

Closed mgoku closed 6 years ago

mgoku commented 6 years ago

As documented at https://www.papaparse.com/docs#json-to-csv, config for parse method is different from config for unparse method.

For example, unparse config has quotes option, which does not exist in parse config.

This library, use PapaParseConfig interface for both parse and unparse method. This cause a compile error when I try to pass {quotes: true} as config parameter for unparse.

this.papa.unparse(data, {quotes: true});

I think we can fix this problem by providing different inteface for parse and unparse.

alberthaff commented 6 years ago

Hi. Thank you for reporting the issue. You are right. I will add a new interface for unparse ASAP.

mgoku commented 6 years ago

Nice, thank you

alberthaff commented 6 years ago

The interface is called PapaUnparseConfig. It is available as of version 2.1.0.

mgoku commented 6 years ago

Thank you