Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: columns config cannot be an array #134

Closed
aomarks opened this issue Feb 1, 2021 · 1 comment
Closed

Regression: columns config cannot be an array #134

aomarks opened this issue Feb 1, 2021 · 1 comment

Comments

@aomarks
Copy link

aomarks commented Feb 1, 2021

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' }
  }
});
@nam-hle
Copy link
Collaborator

nam-hle commented Apr 27, 2021

This issue is resolved. Please help me close it @gajus

@gajus gajus closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants