Currently, when converting rows to JSON (see src/utils/data.js#L387), the code assigns items to an object using the column index as the key, e.g., resultRow[index] = item. This results in objects with numeric keys, which are less readable and less practical for consumers of the exported JSON.
Improvement suggestion:
- Use the
name property of each column (from columns[index].name) as the key instead of the numeric index. This will produce objects with meaningful property names, making the exported JSON more self-descriptive and easier to work with.
- Retain the numeric index as a fallback only if a column name is not specified.
Example of improved output:
{
id: 123,
name: 'Alice',
email: 'alice@example.com'
}
Instead of:
{
0: 123,
1: 'Alice',
2: 'alice@example.com'
}
This change will improve the usability and clarity of data exported in JSON format.
Currently, when converting rows to JSON (see src/utils/data.js#L387), the code assigns items to an object using the column index as the key, e.g.,
resultRow[index] = item. This results in objects with numeric keys, which are less readable and less practical for consumers of the exported JSON.Improvement suggestion:
nameproperty of each column (fromcolumns[index].name) as the key instead of the numeric index. This will produce objects with meaningful property names, making the exported JSON more self-descriptive and easier to work with.Example of improved output:
Instead of:
This change will improve the usability and clarity of data exported in JSON format.