Commit
…n empty array if no matches found
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,7 +238,7 @@ export default (XRegExp) => { | |
} | ||
} | ||
|
||
if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { | ||
if (global && output.length > 0 && !sticky && vN && vN[0] && str.length > lastOuterEnd) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
slevithan
Author
Owner
|
||
output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); | ||
} | ||
|
||
|
Isn't this a breaking change? I was previously relying on the text being returned when the output length was 0.
The workaround was simple on my end, just wanted to highlight that there may be others relying on this (was originally concerned that I broke something! haha)