Commit Graph

5 Commits

Author SHA1 Message Date
Nazar Gargol
fd982fef73 Added mapping support to CSV parser
no issue

- When processing CSV files `parse` function now allows for the client to specify "mapping" parameter in format of a hash as follows:
{ destination_property_name: 'source_column_name'}
e.g.:
{
  name: 'weird_name_column',
  email: 'email_column'
}
- It is done so to allow for the end user to provide exact mapping of the fields to be transformed into JSON.
2020-07-02 14:53:56 +12:00
Nazar Gargol
93ab8ae946 Moved modules into lib folder
no issue

- This fixes a problem where files are skiped form the @tryghost/members-csv package
- Also this follows the file structure convention with other packages
2020-06-19 19:49:39 +12:00
Nazar Gargol
5c47d725cb Fixed tests and added fixtures from Ghost repo 2020-06-19 19:33:43 +12:00
Nazar Gargol
5c46786ebc Colocated readCSV util with members input serializer
refs 8185b42d9e5fd9e9051f08ce3395a648ec02f3a4

- Allows to move files and keep the history in one go.
- 'csv-parser' will be upgraded to 'papaparse' lib in a new package
2020-06-19 19:33:43 +12:00
Nazar Gargol
ca2ab5bbce Initialized members-csv package 2020-06-19 18:54:48 +12:00