You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my opinion, the toCollection method should always return an array (if it does not passed length, then length = 1). The reason for this is very simple: toCollection is used to generate an array of elements. If for some reason you think otherwise, then at least make the correct typing. Currently toCollection always returns the type Collection | Collection[], but should return Collection[] if length is passed.
The example in the specification also needs to be improved:
Proposed solution
No response
Alternatives considered
No response
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered:
Is anyone working on this? seems like a simple fix, I don't mind taking it on, just set the type to return array only right? I think it's ok to return an array of 1 by default even, what's the point of using this function to return just an object??
Description
In my opinion, the toCollection method should always return an array (if it does not passed length, then length = 1). The reason for this is very simple: toCollection is used to generate an array of elements. If for some reason you think otherwise, then at least make the correct typing. Currently toCollection always returns the type Collection | Collection[], but should return Collection[] if length is passed.
The example in the specification also needs to be improved:
Proposed solution
No response
Alternatives considered
No response
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: