Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: transform name capturing regex once (#10395)
* fix: transform name capturing regex once * refactor: early return when pattern contains only lookbehind * chore: simplify test regex * chore: run test on >=8.0.0
- Loading branch information
1 parent
29734b9
commit 2e7bea4
Showing
3 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...l-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/exec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const regex = /(?<=a)(?<a>[a])/ | ||
|
||
const result = regex.exec("aa"); | ||
|
||
expect(result.groups).toEqual({ | ||
a: "a" | ||
}); |
3 changes: 3 additions & 0 deletions
3
...gin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"minNodeVersion": "8.0.0" | ||
} |