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

Deno 0.34 - Strict types #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

olaven
Copy link

@olaven olaven commented Feb 29, 2020

Hi!
Thanks for porting this library!

It breaks with version 0.34 of Deno, released some days ago as strict typing is now enabled by default.

I have made an (imperfect, surely) attempt at supporting strict typing.
Please concider a merge, as strict typing seems to be a standard going forward. (relevant discussion)

Have a nice day!
Olav

main.ts Outdated Show resolved Hide resolved
main.ts Outdated Show resolved Hide resolved
for (i = 0; i < item.cells.length; i++) {
item.cells[i] = splitCells(item.cells[i], item.header.length);
for (i = 0; i < item.cells.length; i++) { //NOTE: risky conversion with toString? -@olaven
item.cells[i] = splitCells(item.cells[i].toString(), item.header.length);
Copy link
Member

Choose a reason for hiding this comment

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

Isn't Tokens.Table already dictates cells to be string[][]? Maybe explicitly mark item declaration to have type Table

Actually it seems that Tokens.Table type annotation of cells seems incorrect (it was copied from DefinitelyTyped) and should be string[].

Copy link
Author

Choose a reason for hiding this comment

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

This may be. However, cells is treated as string[][] other places in the code. E.g. it is expected to be string[][] in 484, as splitCells returns string[].

Perhaps there is something I am not catching here? 😃

main.ts Outdated Show resolved Hide resolved
@olaven
Copy link
Author

olaven commented Mar 2, 2020

Thank you for taking a look!
I will go through the feedback this evening :-)

@zekth
Copy link
Contributor

zekth commented Mar 2, 2020

This also reveals that we might have to setup a CI for it.

@olaven
Copy link
Author

olaven commented Mar 6, 2020

Is there anything else I can do in order to get this merged into master? 😄

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

Successfully merging this pull request may close these issues.

3 participants