Skip to content

Instantly share code, notes, and snippets.

@andylolz
Last active December 30, 2015 07:09
Show Gist options
  • Save andylolz/7794290 to your computer and use it in GitHub Desktop.
Save andylolz/7794290 to your computer and use it in GitHub Desktop.
Uppercase map operator for use with http://datapipes.okfnlabs.org
// Uppercase operator
//
// Transforms all characters in a data file to
// uppercase
function transform(chunk) {
// `transform(chunk)` is called on each
// chunk (in the case of csv, each line) of
// the data file.
var json = JSON.parse(chunk);
for(var x = 0; x < json.row.length; x++) {
json.row[x] = json.row[x].toUpperCase();
}
return JSON.stringify(json);
}
function flush() {
// `flush()` is called after all the
// data has been passed through.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment