-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
Description
The pattern is reduced from what I'm trying to write. I'd like to use OR {}
but because each branch will contain different amount of captures, I write multiple ?
matchers after each other. *
and +
can return 0-n and 1-n matches so it totally makes sense to return an array for these. +
on the other hand is ony 0-1 so I'd expect this to be either be the node or nil
.
Can't change this now without a major version bump of course and the solution for me is to just call flatten
somewhere in the code but I wanted to see what others think. Does my "complaint" make sense?