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

fix: use ReadonlyArray type for table parameter / align option #30

Merged
merged 1 commit into from Nov 30, 2022

Conversation

bmish
Copy link
Contributor

@bmish bmish commented Nov 28, 2022

This should be a backwards-compatible improvement to the markdownTable function parameter/option TypeScript types. In addition to allowing regular (writable/mutable) arrays, the user can now provide read-only arrays. This is possible because markdown-table does not modify these input arrays anyway.

Without this change, someone wanting to pass a read-only array to this function would have to first recreate the array (like [...arr]) in order to do so.

Related documentation about the readonly arrays in TypeScript:

Copy link

@remcohaszing remcohaszing left a comment

Choose a reason for hiding this comment

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

I think this makes sense for options / arguments

@wooorm wooorm merged commit 0107259 into wooorm:main Nov 30, 2022
@wooorm
Copy link
Owner

wooorm commented Nov 30, 2022

Thanks, released in 3.0.3!

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.

None yet

3 participants