pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 1 | function capitalize(s) |
2 | { | ||||
3 | return s[0].toUpperCase() + s.slice(1); | ||||
4 | } | ||||
5 | |||||
6 | function keyValueList(data) { | ||||
7 | let out = ""; | ||||
8 | Object.entries(data).map(([key, value]) => { | ||||
9 | out += `**${capitalize(key)}:** ${value}\n` | ||||
10 | }) | ||||
11 | return out; | ||||
12 | } | ||||
13 | |||||
14 | export default keyValueList; |