Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Function table() does not respect TableOptions overrides set by caller #37

Closed
VivekMChawla opened this issue Jun 4, 2018 · 1 comment · Fixed by #40
Closed

Function table() does not respect TableOptions overrides set by caller #37

VivekMChawla opened this issue Jun 4, 2018 · 1 comment · Fixed by #40

Comments

@VivekMChawla
Copy link

The table() function as currently defined in src/styled/table.ts does not respect TableOptions overrides set by the caller.

I believe that this is due to the placement of ...inputOptions BEFORE the definition of the default TableOption properties.

...inputOptions,

My understanding of the spread operator is that whatever comes last when performing an object merge is what "wins". Since the defaults are defined after ...inputOptions, they always win.

I've tested this by moving ...inputOptions between the definition of columns: and the definition of the other default TableOptions (eg. colSep, printLine, etc). I can confirm that the options are respected when placed like this.

paulelliott added a commit that referenced this issue Jun 19, 2018
@jdx jdx closed this as completed in #40 Jun 19, 2018
jdx pushed a commit that referenced this issue Jun 19, 2018
oclif-bot added a commit that referenced this issue Jun 19, 2018
## [4.7.2](v4.7.1...v4.7.2) (2018-06-19)

### Bug Fixes

* **table:** Allow user to override tableoptions ([#40](#40)) ([14b972e](14b972e)), closes [#37](#37)
@oclif-bot
Copy link
Contributor

🎉 This issue has been resolved in version 4.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants