Commit f57c2f9
Improve RegEx parser, reduce possibilities as the key for arbitrary properties (#12121)
* optimize handling of RegEx parser results
Previous:
- Copy `results`, for every subsequent result of other `patterns`
- Loop over results to filter out `undefined` values
- Loop over results to map to `clipAtBalancedParens`
Current:
- For each candidate, push the `clipAtBalancedParens(candidate)` into
the `results`
This way we are not copying existing results, and we are also avoiding
additional loops over the entire array to filter out `undefined` values
and map to `clipAtBalancedParens`.
* do not allow `]` in the first part of arbitrary properties
```
[foo:bar]
─┬─
└── This part cannot contain `]`
```
This is also a very targeted fix for when the arbitrary properties seem
to match a large piece of text, but shouldn't
* add real world tests for parsing candidate strings
* sync package-lock.json
* update changelog1 parent 2c23b8d commit f57c2f9
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
0 commit comments