From 971a562b46487f7699708014dacce950681b58d5 Mon Sep 17 00:00:00 2001 From: Naz Date: Thu, 13 Oct 2022 12:16:35 +0800 Subject: [PATCH] Added JSDoc to members csv parser refs https://github.com/TryGhost/Toolbox/issues/430 - Typings make developer's life nicer --- ghost/members-csv/lib/parse.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ghost/members-csv/lib/parse.js b/ghost/members-csv/lib/parse.js index 3df59412c2..8aeb3bbd57 100644 --- a/ghost/members-csv/lib/parse.js +++ b/ghost/members-csv/lib/parse.js @@ -3,6 +3,13 @@ const pump = require('pump'); const papaparse = require('papaparse'); const fs = require('fs-extra'); +/** + * + * @param {string} path - The path to the CSV to prepare + * @param {Object.} mapping - An object whose keys are headers in the input CSV and values are the header to replace it with + * @param {Array} [defaultLabels] - A list of labels to apply to every parsed member row + * @returns + */ module.exports = (path, mapping, defaultLabels = []) => { const inputMapping = Object.assign({}, mapping, { subscribed_to_emails: 'subscribed'