Open Nness opened 4 weeks ago
We aim to support read-only arrays if possible. Although not written in the documentation, most functions take readonly arrays in their arguments by default.
Is there some specific functions that you need?
Thanks for making the lists. Let me add support for them.
Such as
orderBy
,uniq
etc, Inlodash
they supportArrayLike
object, which is handy, of course the problem I am facing is less to do withArrayLike
and more related toReadOnlyArray<T>
in TypeScript. I don't think everyone is utilizeReadOnlyArray<T>
, nor is the syntax provide any real value, it is a tool for me to describe the intention. Else people might modify the array, map or set that I intended treat it as immutable.From the source code, I can see the code base mainly utilize on modern Array related function, it also use
slice()
to duplicate the array then perform the action such asorderBy
. Then there is no reason not to supportReadOnlyArray<T>
. Unless I missed something.