Skip to content

Conversation

@comp615
Copy link
Contributor

@comp615 comp615 commented May 12, 2022

Because doing something like:

await knex('workflow').whereIn(myArray)

will not modify myArray, if we mark the TS-type as ReadOnly, it makes the type more accessible for a variety of use-cases (i.e. readonly arrays can be passed in). Note that mutable arrays can still be cast into read only so this is "backwards compatible" type-wise.

Fixes #2271

@comp615
Copy link
Contributor Author

comp615 commented May 25, 2022

@koskimas lmk if you have any questions or qualms here!

@comp615
Copy link
Contributor Author

comp615 commented Jun 24, 2022

@koskimas Any way we can get this change in and released? Would be really helpful for typesafe code and should not be functionality impacting so low-risk

@comp615
Copy link
Contributor Author

comp615 commented Feb 8, 2023

@kibertoad wanted to flag this as a (hopefully) simple TS def fix for a potential minor version release!

@comp615
Copy link
Contributor Author

comp615 commented Apr 10, 2023

@falkenhawk are you the new maintainer? Trying to get this picked up for a future build at some point!

@falkenhawk
Copy link
Contributor

I'm not, currently @kibertoad is

@lehni
Copy link
Collaborator

lehni commented Apr 14, 2023

@comp615 this look good, thanks!

@lehni lehni merged commit 60e4f36 into Vincit:master Apr 14, 2023
@comp615 comp615 deleted the patch-1 branch June 14, 2023 21:53
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.

Using typescript readonly variable as a PrimitiveValue

3 participants