function toJSON(dataTable) {
let date, block, location, arrested, type, info, lat, lng, results = [];
dataTable.scan((index) => {
results.push({
'Date': toDate(date(index)).toISOString().substring(0, 10),
'Location': `${block(index)} (${location(index).toLowerCase()})`,
'Arrested': arrested(index),
'Description': `${type(index).toLowerCase()}: ${info(index).toLowerCase()}`,
});
}, (batch) => {
date = arrow.predicate.col('Date').bind(batch);
block = arrow.predicate.col('Block').bind(batch);
location = arrow.predicate.col('LocationDescription').bind(batch);
arrested = arrow.predicate.col('Arrest').bind(batch);
type = arrow.predicate.col('PrimaryType').bind(batch);
info = arrow.predicate.col('Description').bind(batch);
lat = arrow.predicate.col('Latitude').bind(batch);
lng = arrow.predicate.col('Longitude').bind(batch);
}
);
return results;
}