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

[refactor] Consistency schema and typing #165

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

nam-hle
Copy link
Collaborator

@nam-hle nam-hle commented Apr 25, 2021

columnDefault and columnCount are required in API interfaces but not in the schema. This PR makes it requirable, the errors will be thrown in validating step instead of processing one.
The remain difference between typing and schema is about streamConfig.columnDefault.width.

Also, remove row assertion because it already checks in validateTableData.ts file.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 328

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 325: 0.0%
Covered Lines: 341
Relevant Lines: 341

💛 - Coveralls

@coveralls
Copy link

coveralls commented Apr 25, 2021

Pull Request Test Coverage Report for Build 334

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 332: 0.0%
Covered Lines: 338
Relevant Lines: 338

💛 - Coveralls

@@ -7,10 +7,6 @@ import type {
* Produces an array of values that describe the largest value length (width) in every column.
*/
export default (rows: Row[]): number[] => {
if (!rows[0]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this code run on the data, not the config?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. On data. But it is checked in validateTableData.ts.

@gajus gajus merged commit 2a5796e into gajus:master Apr 26, 2021
@nam-hle nam-hle deleted the consistent-schema branch April 26, 2021 03:17
@gajus
Copy link
Owner

gajus commented Apr 27, 2021

🎉 This PR is included in version 6.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

4 participants