fix(deps): update dependency xregexp to v5
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| xregexp (source) | 4.3.0 -> 5.1.1 |
Release Notes
slevithan/xregexp (xregexp)
v5.1.1
v5.1.0
Breaking Changes
-
XRegExp.matchRecursive: When doing a global, non-sticky search and providingvalueNames, return an empty array if no matches are found, rather than an array with one object containing abetweenvalue that contains the whole target string (this change is to match every other case when no matches are found, e.g. when not providingvalueNames, not using global with flagg, or doing a sticky search with flagy):6e1711e
Improvements
-
XRegExp.matchRecursive: Add support for matching with unbalanced delimiters (newunbalancedoption with supported values'error'[default],'skip', and'skip-lazy'): #96 - Upgrade to Unicode 14.0.0:
0f52a62
v5.0.2
- Fix TypeScript definition for
XRegExp.matchChain: #325 - Fix
XRegExp.escapeto handle-,,, and#in a way that is compatible with ES6 flagu: #323
v5.0.1
- Hotfix for broken npm package.
- Adds
docsfolder with extensive documentation.
v5.0.0
Breaking Changes
- Enable the
namespacingfeature by default for alignment with ES2018 (moves named capture properties to thegroupsobject of matches and to the last argument of replacement callbacks): https://github.com/slevithan/xregexp/pull/316 - Handle ES2018 capture names (mostly this adds support for an extended set of Unicode characters, but it also prevents using a number as the first character in a capture name): https://github.com/slevithan/xregexp/pull/247
- Remove support for Unicode blocks, for alignment with ES2018 (use Unicode scripts instead): https://github.com/slevithan/xregexp/issues/225
Improvements
- Support optional '
Script=' prefix (from ES2018 syntax) for Unicode script tokens: https://github.com/slevithan/xregexp/issues/225 -
XRegExp.matchRecursive: Add delimiter and position info to error when unbalanced delimiters are found: https://github.com/slevithan/xregexp/issues/293 - Avoid inserting unneeded
(?:)into native regex source in more cases: https://github.com/slevithan/xregexp/commit/076f9501965d9ddc4f1cf7b7626c77993b396a01 and https://github.com/slevithan/xregexp/commit/d78a26216691c975acf5424f371db9763f307c7a - Defer to native flag
sin ES2018 environments: https://github.com/slevithan/xregexp/commit/98abea85ed0da1e1b40d9b26cc6a299c297b8eae
Bug Fixes
-
XRegExp.exec: Preserve thegroupsobject that comes from native ES2018 named capture: https://github.com/slevithan/xregexp/commit/c4a83e76fc3e1ab5a9053618267dff33edd1174e -
XRegExp.exec: Set thegroupsproperty toundefinedif there are no named captures: https://github.com/slevithan/xregexp/issues/320 -
XRegExp.escape: Escape whitespace in a way that works with ES6 flagu: https://github.com/slevithan/xregexp/issues/197 -
XRegExp.replace: Throw when using native named capture and a numbered backreference one higher than the number of captures in the replacement text: https://github.com/slevithan/xregexp/issues/317 -
XRegExp.replace: Fix edge case issues with replacement text syntax: https://github.com/slevithan/xregexp/issues/318
v4.4.1
- Add browser field to package.json to fix webpack: https://github.com/slevithan/xregexp/pull/308
v4.4.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
Hi! XRegExp v5 has a breaking change described at https://github.com/slevithan/xregexp#named-capture-breaking-change-in-xregexp-5
Specifically, named backreference properties now appear on the result's groups object (following ES2018), rather than directly on the result. To restore the old handling so you don't need to update old code, run the following line after importing XRegExp: XRegExp.uninstall('namespacing').
XRegExp 4.1.0 and later allow introducing the new behavior without upgrading to XRegExp 5 by running XRegExp.install('namespacing').
Following is the most commonly needed change to update code for the new behavior:
// Change this
const name = XRegExp.exec(str, regexWithNamedCapture).name;
// To this
const name = XRegExp.exec(str, regexWithNamedCapture).groups.name;
Let me know if you have any questions and I'll be happy to help!