Skip to content

Commit 3450b4b

Browse files
committed
Added JSDoc to members csv parser
refs https://github.com/TryGhost/Toolbox/issues/430 - Typings make developer's life nicer
1 parent cd837d6 commit 3450b4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/members-csv/lib/parse.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ const pump = require('pump');
33
const papaparse = require('papaparse');
44
const fs = require('fs-extra');
55

6+
/**
7+
*
8+
* @param {string} path - The path to the CSV to prepare
9+
* @param {Object.<string, string>} mapping - An object whose keys are headers in the input CSV and values are the header to replace it with
10+
* @param {Array<string>} [defaultLabels] - A list of labels to apply to every parsed member row
11+
* @returns
12+
*/
613
module.exports = (path, mapping, defaultLabels = []) => {
714
const inputMapping = Object.assign({}, mapping, {
815
subscribed_to_emails: 'subscribed'

0 commit comments

Comments
 (0)