refactor(turbopack): Rewrite `EsRegex::captures` to return an iterator, use…
refactor(turbopack): Rewrite `EsRegex::captures` to return an iterator, use `None` for unmatched capture groups (#81200) This is a follow-up to #81119. - Make each returned capture use `Option` and return `None` if the capture doesn't match instead of an empty string. There is a meaningful difference between a capture not matching at all or a zero-width capture. - Return an iterator instead of a `Vec`. Some lifetime issues with both `regex` and `regress` pushed me to make this a manual iterator implementation (versus using `Either`), but the upside is that the type is now named!
Showing
Please
register
or
sign in
to comment