Skip to content

Auto type detection and auto header [enhancement] #40

Description

@damianobarbati

Wouldn't the following be much easier to use?

{
    filename: 'general-ledger-Q1',
    sheet: {
        data: [
            [{
                value: 'Income - Webshop',
                type: 'string'
            }, {
                value: 1000,
                type: 'number'
            }]
        ]
    }
}
//==>
{
    filename: 'general-ledger-Q1',
    data: [{
        'Income - Webshop': 1000, 
        'my second column': 'hello',
        'my third column': 'world',
    },{
        'Income - Webshop': 1000,
        'my second column': 'hello',
        'my third column': 'world',
    },{
        'Income - Webshop': 1000,
        'my second column': 'hello',
        'my third column': 'world',
    }],
}
  • header (or better first line of xlsx) can automatically detected with an Object.keys on first row or an array can be given into config to consider just specific set of properties in array
  • String or Number is automatically detected from the value when populating the xlsx

This way no processing on the dataset would be required to developer at all, since typically we'd have an array of objects.

Great library man 👍🏻

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions