Created
July 26, 2016 17:43
-
-
Save mca-gif/a331ddcaf5314da853761b8feb6ac689 to your computer and use it in GitHub Desktop.
JSON Data Extractor for the IntelliJ IDEA Platform
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
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); } | |
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; } | |
OUT.append(JSON.stringify( mapEach(ROWS, function(row, row_idx) { | |
var r = {}; | |
eachWithIdx(COLUMNS, function(col, col_idx) { r[ col.name() ] = row.value(col); }); | |
return r; | |
}))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment