Closed kgar closed 2 years ago
If this is implemented, update the cookbook so that the mapping step is not required.
Accidentally pushed straight to main branch. Oops! I'll lock things down a bit more. But yet, this feature has been implemented 😞
Currently, when I want to make human readable columns from data with camelCase properties, I have to perform a mapping step. See this recipe in the cookbook.
The upgrade
As a ts-markdown user, I would like to be able to specify the
field
which a column refers to in the data.Given this input:
I would expect this output:
Defaults
When a
field
is not specified, the columnname
is used for accessing the data from the object.TypeScript bonus content
For those who want it, it would be nice to be able to reference a generic version of the
TableEntry
which will provide TypeScript property name checking on the data set when specifying fields on the column, when fields are provided. When a field isn't provided on a column, then the typing would perform the same check on thename
property.