Skip to content

Regression: columns config cannot be an array #134

@aomarks

Description

@aomarks

Somewhere between versions 6.0.3 and 6.0.7, passing an array of column configs stopped working. A validation error is now raised. The workaround is to pass an object with numeric keys. I think the array form is more natural and should also be valid.

Input:

table(rows, {
  columns: [
    { alignment: 'right' }
  ]
});

Error:

errors [
  {
    dataPath: '/columns',
    message: 'should be object',
    params: { type: 'object' },
    schemaPath: '#/type'
  }
]

Workaround:

table(rows, {
  columns: {
    0: { alignment: 'right' }
  }
});

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