Format CSV

This commit is contained in:
Norbert Renner 2021-04-01 12:17:18 +02:00
parent 00f2cead36
commit 0fc468a682
2 changed files with 16 additions and 0 deletions

14
js/format/Csv.js Normal file
View file

@ -0,0 +1,14 @@
BR.Csv = {
format: function (geoJson) {
const separator = '\t';
const newline = '\n';
const messages = geoJson.features[0].properties.messages;
let csv = '';
for (const entries of messages) {
csv += entries.join(separator) + newline;
}
return csv;
},
};