function printTableTypes(data, verticalOrientation = true, useRowIndex = 1, maxWidth = 250){
const header = (data[0] && Object.keys(data[0]));
if(useRowIndex < data.length){
const row = (data[useRowIndex] && Object.values(data[useRowIndex]));
let types = {};
for(let i = 0; i < row.length; i++){
if(row[i] instanceof Date){
types[header[i]] = "date";
}else{
types[header[i]] = typeof(row[i]);
}
}
if(verticalOrientation){
let listOfFieldsAndTypes = [];
for(let type in types){
listOfFieldsAndTypes.push({'field' : type, 'data type' : types[type]});
console.log(type);
}
return printTable(listOfFieldsAndTypes, undefined, maxWidth, false);
}else{
return printTable([types], undefined, undefined, false);
}
}
}