feat(ts): set columns type as readonly#358
Merged
wdavidw merged 1 commit intoadaltas:masterfrom Mar 15, 2024
Merged
Conversation
The goal is for stringify to support values declared `as const`.
eg.
```
const columns = ['name', 'age'] as const
stringify({columns})
```
As this array has no reasons to be mutated by `stringify` it's simpler to set it as `readonly`.
Member
|
This is pretty much the case for every option. Not sure it provide much value. |
Contributor
Author
|
If you try the following code without this PR patch, it won't compile - even though it's perfectly valid at runtime. |
|
Recently, I encountered the same problem. It would be helpful to support values declared |
Touffy
approved these changes
Aug 25, 2023
Member
|
Then I propose to update this PR to apply |
|
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal is for stringify to support values declared
as const.eg.
As this array has no reasons to be mutated by
stringifyit's simpler to set it asreadonly.