Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function formatStickies(format, stickies) {
switch (format) {
case 'csv': {
const records = stickies.map(Sticky.toCSV);
records.unshift(Sticky.props);
return csv.stringify(records);
}
case 'json':
return JSON.stringify(stickies);
default:
return '';
}
}