fix(deps): update dependency xregexp to v5
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| xregexp (source) | 2.0.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
- Upgrade to Unicode 13.0.0
- Add TypeScript definitions and tests #285 #286 #288
- Fix infinite loop in IE11 when used with core-js 3.6.0+ #300
v4.3.0
- Upgrade to Unicode 12.1.0 : https://github.com/slevithan/xregexp/pull/278
- Upgrade to @babel/runtime-corejs3 : https://github.com/slevithan/xregexp/pull/280
v4.2.4
Update @babel dependencies to v7.2.x
v4.2.3
Hotfix for Babel removing core-js from the runtime package.
v4.2.2
v4.2.0
Upgrades the Unicode addons to Unicode 11.0.0.
v4.1.1
Hotfix for npm package missing the tools/output directory. No code changes.
v4.1.0
New Features
- Added installable
namespacingoption (off by default) that moves named capture results to agroupsobject. This makes it easier to loop over named captures after executing a regex, and aligns with native named capture handling in ES2018. See #175. - Added the
Cased_Letter(LC) category to the Unicode Categories addon. See #220.
Improvements
- Upgraded Unicode data from version 9.0.0 to 10.0.0. See #221.
- The generated source for regexes is now a bit easier to read, with fewer
(?:)separating tokens. See #196.
v4.0.0
Breaking Changes
- XRegExp is now published as ES5, rather than ES3. See https://github.com/slevithan/xregexp/issues/108.
-
XRegExp.install('natives')was removed. See https://github.com/slevithan/xregexp/pull/207.
New Features
-
XRegExp.tagwas added to thebuildplugin for tagged template string construction. See https://github.com/slevithan/xregexp/pull/180. -
$<n>and$<name>can be used as alternative backreference syntax in replacement text. See https://github.com/slevithan/xregexp/pull/181.
v3.2.0
v3.1.1
v3.1.0
v3.0.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!