This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (async function generateReplies(document) { | |
| // https://conventionalcomments.org/#labels | |
| const LABEL = { | |
| praise: "praise", | |
| nitpick: "nitpick", | |
| suggestion: "suggestion", | |
| issue: "issue", | |
| todo: "todo", | |
| question: "question", | |
| thought: "thought", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const jsonToCSV = (objArray: any[]): string => { | |
| let headerRow = ''; | |
| let result = ''; | |
| const columns: any[] = []; | |
| const keys = Object.keys(objArray[0]); | |
| keys.forEach((key, index) => { | |
| let keyString = `${key}`; | |
| keyString = `"${keyString.replace(/"/g, '""')}",`; // escape quotes using double quotes and wrap in quotes | |
| columns[index] = key; |