-
Notifications
You must be signed in to change notification settings - Fork 337
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: add the type readonly array to the partition #32
Conversation
@ssi02014 is attempting to deploy a commit to the Toss Team on Vercel. A member of the Team first needs to authorize it. |
I think this |
Hi @ssi02014, thanks for your contribution! As you mentioned, our library does not currently support Meanwhile, This would affect a large portion of our function interfaces, and I think using Because of our design principles which value simplicity, I think this would not meet our design principle. What do you think? |
@raon0211 Thank you for your feedback 🙏 In my case, I wanted to narrow down the types as much as possible in my development, so I was disappointed to see a type error when using a readonly array.
The I think it's worth considering whether it's more appropriate to keep the existing principle and preclude users from using readonly, or to add the readonly type but change the function interface. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
How about this? Since For example, the signature of function partition<T>(arr: readonly T[], isInTruthy: (value: T) => boolean): [truthy: T[], falsy: T[]]; However, I'd like our documentation to state that |
@raon0211 But, How do you feel about documentation and code being out of sync, which can lead to confusion? I will follow the direction of the |
I think for the sake of simplicity, the docs and implementation could go a little bit out of sync. |
@raon0211 I've reverted the document, annotations I was working on. thank you! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hello 👋 Here's a suggestion.
Currently, it does not work correctly for arrays with
const assertion
applied.I think it would be nice to add a
readonly T[]
type, what do you think?AS-IS
TO-BE