Last active
December 30, 2015 07:09
-
-
Save andylolz/7794290 to your computer and use it in GitHub Desktop.
Uppercase map operator for use with http://datapipes.okfnlabs.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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