TDJSON function to encode table dats to JSON objects

Attached is an example of the functionality I’m thinking of. The function takes a table dat as its first argument.
keyBy allows you to select whether the first row, or first column is a list of keys (keyBy=“col” means it will take the first row)
valIndex selects the row or column index to take values from. for example, with keyBy=“col”, valIndex=1, the second row of cells will be matched to the first row of keys in the same column.
implicitConversation=True will test whether a cell value is an int, float, or boolean, and convert it. This is done by a nested function employing regular expressions.

Another option that would be nice would be to convert the entire table, so instead of choosing a value index, all the cells in a column (or row), would be placed inside a list in the json dictionary. And then of course a function to do this in reverse, and unpack the json into a different table.

tableToJson.tox (1.3 KB)