Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
date = parseRowsMappedArray[0].year;
str = parseRowsMappedArray[0].make;
str = parseRowsMappedArray[0].model;
num = parseRowsMappedArray[0].length;
// tsvFormat(...) ============================================================================
str = d3Dsv.tsvFormat(parseRowsMappedArray);
str = d3Dsv.tsvFormat(parseRowsMappedArray, columns);
// tsvFormatRows(...) ========================================================================
str = d3Dsv.tsvFormatRows(parseRowsMappedArray.map((d, i) => [
d.year.getFullYear().toString(),
d.make,
d.model,
d.length.toString()
]));
// ------------------------------------------------------------------------------------------
// Test DSV Generalized Parsers and Formatters
// ------------------------------------------------------------------------------------------
// Create custom-delimited Parser/Formatter =================================================
let dsv: d3Dsv.DSV;
dsv = d3Dsv.dsvFormat('|');
// parse(...) ============================================================================
// now we need to find which module to use for the conversion
var parsed = "",
parse_error = false,
parse_error_msg = "";
if (this.isColumnHeader) {
try {
parsed = tsvFormat( this.getJSON() );
parse_error = false;
} catch (e) {
parse_error = true;
parse_error_msg = "TSV conversion Failed. Please check if JSON is array of objects.";
}
} else {
try {
parsed = tsvFormatRows( this.getJSON() );
parse_error = false;
} catch (e) {
parse_error = true;
parse_error_msg = "TSV conversion Failed. Please check if JSON is array of arrays.";
}
}
if (parse_error) {
// show the error message
Materialize.toast( parse_error_msg, 4000 );
// do not proceed
return;
}
console.log("All success! proceed to download");
this.downloadFile( parsed, "tsv" );
langs.map(lang => {
const unTranslateMessages = getLangUnTranslate(lang);
if (unTranslateMessages.length === 0) {
console.log(`${lang} 该语言文件以及全部被翻译`);
}
const content = tsvFormatRows(unTranslateMessages);
fs.writeFileSync(`./export-${lang}`, content);
console.log(`${lang} 该语言导出 ${unTranslateMessages.length} 未翻译文案.`);
});
}